luckydexte
Programmer
Hello,
I have a form with a dropdown list and text box. I also have a reset button. I am trying to reset the dropdown list to the first value but I am not having any success. The text box is clearing so I know that I am getting to the Javascript function. My form and Javascript function are below. Any help would be appreciated.
Brandon Goodman
<form name="edu" method="post" action=" >
<select name="category" size="1">
<option value="">All
<option value="ASP" selected>ASP Classes
<option value="C#">C# Classes
<option value="HTML">HTML Classes
</select>
<input type="text" name="desc" size="30" maxlength="30" value="XXX"></td>
<input type="button" name="reset" value=" Reset " onclick="javascript:resetFields(document.edu);">
Javascript:
function resetFields(form) {
form.category.selectedindex = 0;
form.desc.value = "";
}
I have a form with a dropdown list and text box. I also have a reset button. I am trying to reset the dropdown list to the first value but I am not having any success. The text box is clearing so I know that I am getting to the Javascript function. My form and Javascript function are below. Any help would be appreciated.
Brandon Goodman
<form name="edu" method="post" action=" >
<select name="category" size="1">
<option value="">All
<option value="ASP" selected>ASP Classes
<option value="C#">C# Classes
<option value="HTML">HTML Classes
</select>
<input type="text" name="desc" size="30" maxlength="30" value="XXX"></td>
<input type="button" name="reset" value=" Reset " onclick="javascript:resetFields(document.edu);">
Javascript:
function resetFields(form) {
form.category.selectedindex = 0;
form.desc.value = "";
}