嗨我已經在我的網站上創建了一個窗體。我正在使用placeholder="Full Name"
,但是在IE8(以及其他IE版本)中查看時沒有任何內容顯示在窗體中HTML窗體「佔位符」不工作在IE 8
我試過使用value="" onfocus="if (this.value == 'Full Name') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Full Name';}"
,但表單仍爲空。出於某種原因,當您單擊表單時出現「全名」,然後關閉它。
我正在研究的網站是[usspcatalystcentre.org.uk] [1],你可以看到我的意思。前兩種形式(標題&全名)是我已經使用
value="" onfocus="if (this.value == 'Full Name') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Full Name';}"
形式的其餘部分在哪裏我剛使用placeholder
下面是實際的代碼我工作的嘗試
<form action="contact.php" method="post">
<input id=title name=title type=text value="" onfocus="if(this.value=='Username') this.value='';" onblur="if(this.value=='') this.value='Username';" required class="top-formfields" value='<?php print $_SESSION['title']?>'> <br /><br />
<input id=fullname name=fullname type=text value="" onfocus="if(this.value=='Full Name') this.value='';" onblur="if(this.value=='') this.value='Full Name';" required class="top-formfields" value='<?php print $_SESSION['fullname']?>'> <br /><br />
<input id=companyname name=companyname type=text placeholder="Company Name" required class="top-formfields" value='<?php print $_SESSION['companyname']?>'> <br /><br />
<input id=companynumber name=companynumber type=text placeholder="Company Registered Number" required class="top-formfields" value='<?php print $_SESSION['companynumber']?>'> <br /><br />
<textarea id=address name=address rows=5 placeholder="Address" required class="top-textarea"><?php print $_SESSION['address']?></textarea> <br /><br />
<input id=postcode name=postcode type=text placeholder="Post Code" required class="top-formfields" value='<?php print $_SESSION['postcode']?>'> <br /><br />
<input id=phonenumber name=phonenumber type=text placeholder="Phone Number" required class="top-formfields" value='<?php print $_SESSION['phonenumber']?>'> <br /><br />
<input id=email name=email type=text placeholder="Email" required class="top-formfields" value='<?php print $_SESSION['email']?>'> <br /><br />
<input id=mobile name=mobile type=text placeholder="Mobile" required class="top-formfields" value='<?php print $_SESSION['mobile']?>'> <br /><br />
<input id=website name=website type=text placeholder="Website URL" required class="top-formfields" value='<?php print $_SESSION['website']?>'> <br /><br />
在此先感謝,湯姆
任何版本的IE都不支持佔位符屬性。 –