Reset form, Checked radio button?
this form resets form doesn't allow me check radio button.
<html>
<head>
<title>taming form's reset button javascript</title>
<script language="javascript" type="text/javascript">
<!--
function reset_form()
{
if ( confirm("are sure want reset form?") )
{
window.document.myform.reset();
}
else
{
window.document.myform.search.focus();
}
}
//-->
</script>
</head>
<body>
<form action="script.php" method="post" name="myform">
search: <input type="text" name="search" value="" />
<input type="submit" name="submit" value="submit" />
<script language="javascript" type="text/javascript">
<!--
window.document.write("<input type='button' name='resetbutton' value='reset'
onclick='reset_form();' />");
//-->
</script>
</form>
</body>
</html>
<html>
<head>
<title>taming form's reset button javascript</title>
<script language="javascript" type="text/javascript">
<!--
function reset_form()
{
if ( confirm("are sure want reset form?") )
{
window.document.myform.reset();
}
else
{
window.document.myform.search.focus();
}
}
//-->
</script>
</head>
<body>
<form action="script.php" method="post" name="myform">
search: <input type="text" name="search" value="" />
<input type="submit" name="submit" value="submit" />
<script language="javascript" type="text/javascript">
<!--
window.document.write("<input type='button' name='resetbutton' value='reset'
onclick='reset_form();' />");
//-->
</script>
</form>
</body>
</html>
lee wrote:
> form resets form doesn't allow me check radio button.
>
>
<script type="text/javascript">
function reset_form(formname,searchname){
if(confirm("are sure want reset form?")){
document.forms[formname].reset();
return;
}
document.forms[formname].elements[searchname].focus();
}
</script>
<form ...>
<input type="button" value="reset" onclick='reset_form(this.form,"search")'>
<input type="text" name="search">
</form>
> <html>
> <head>
> <title>taming form's reset button javascript</title>
> <script language="javascript" type="text/javascript">
> <!--
> function reset_form()
> {
> if ( confirm("are sure want reset form?") )
> {
> window.document.myform.reset();
> }
>
> else
> {
> window.document.myform.search.focus();
> }
> }
> //-->
> </script>
> </head>
> <body>
> <form action="script.php" method="post" name="myform">
> search: <input type="text" name="search" value="" />
> <input type="submit" name="submit" value="submit" />
> <script language="javascript" type="text/javascript">
> <!--
> window.document.write("<input type='button' name='resetbutton' value='reset'
> onclick='reset_form();' />");
> //-->
> </script>
> </form>
> </body>
> </html>
>
>
> form resets form doesn't allow me check radio button.
>
>
<script type="text/javascript">
function reset_form(formname,searchname){
if(confirm("are sure want reset form?")){
document.forms[formname].reset();
return;
}
document.forms[formname].elements[searchname].focus();
}
</script>
<form ...>
<input type="button" value="reset" onclick='reset_form(this.form,"search")'>
<input type="text" name="search">
</form>
> <html>
> <head>
> <title>taming form's reset button javascript</title>
> <script language="javascript" type="text/javascript">
> <!--
> function reset_form()
> {
> if ( confirm("are sure want reset form?") )
> {
> window.document.myform.reset();
> }
>
> else
> {
> window.document.myform.search.focus();
> }
> }
> //-->
> </script>
> </head>
> <body>
> <form action="script.php" method="post" name="myform">
> search: <input type="text" name="search" value="" />
> <input type="submit" name="submit" value="submit" />
> <script language="javascript" type="text/javascript">
> <!--
> window.document.write("<input type='button' name='resetbutton' value='reset'
> onclick='reset_form();' />");
> //-->
> </script>
> </form>
> </body>
> </html>
>
>
More discussions in Dreamweaver support forum
adobe
Comments
Post a Comment