JavaScript DHTML/Form Control/Accept

Материал из Web эксперт
Перейти к: навигация, поиск

"acceptCharset" Example

    
<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>



"accept" Example

    
<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>



"enctype" Example

    
<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>



Form "encoding" Example

    
<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>