JavaScript DHTML/Form Control/Accept
Версия от 12:59, 26 мая 2010; (обсуждение)
Содержание
"acceptCharset" Example
<source lang="html4strict">
<html> <head> <script language="JavaScript"> function goAcceptCharset() {
alert(document.all.myForm.acceptCharset);
} </script> </head> <body onLoad="goAcceptCharset();"> <form id="myForm" method="post" action="" acceptcharset="UTF-8"> some input fields </form> </body> </html>
</source>
"accept" Example
<source lang="html4strict">
<html> <head> <script language="JavaScript"> function goAccept() {
document.all.myB.accept = "image/gif";
} </script> </head> <body onLoad="goAccept();"> <input type="text"
name="textfield" size="50" accept="image/gif" value="The content type of this field is "text/html"">
<input type="button"
id="myB" value="The content type for this button is "image/gif"">
</body> </html>
</source>
"enctype" Example
<source lang="html4strict">
<html> <body> <form id="myForm" method="post">
<button onclick="alert(document.all.myForm.encoding);">encoding</button> <button onclick="alert(document.all.myForm.enctype);">enctype</button>
</form> </body> </html>
</source>
Form "encoding" Example
<source lang="html4strict">
<html> <body> <form id="myForm" method="post">
<button onclick="alert(document.all.myForm.encoding);">encoding</button> <button onclick="alert(document.all.myForm.enctype);">enctype</button>
</form> </body> </html>
</source>