こんにちは、ウェブサイトにフォームを作成しました。私は使用していますplaceholder="Full Name"
が、IE8 (およびおそらく他の IE バージョン) で表示すると、フォームに何も表示されません。
使用してみvalue="" onfocus="if (this.value == 'Full Name') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Full Name';}"
ましたが、フォームはまだ空です。何らかの理由で、フォームをクリックしてからオフにすると「氏名」が表示されます。
私が取り組んでいるウェブサイトは [usspcatalystcentre.org.uk][1] で、私の言いたいことがわかるでしょう。最初の 2 つの形式 (タイトルと氏名) は、私が使用しようとした場所です
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 />
前もってありがとう、トム