JavaScript DHTML/Form Control/Accept — различия между версиями

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

Версия 09:59, 26 мая 2010

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