Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reset button

Status
Not open for further replies.

almoes

Programmer
Jan 8, 2003
291
US
Hi!

I have a reset button on a form on an asp file, but if I press it nothing happens. This is part of the code:

<form method=&quot;GET&quot; name=&quot;menuForm&quot; action=&quot;TheSamePage.asp&quot;>
<table>
...
<input TYPE=&quot;reset&quot; name=&quot;Reset&quot; value=&quot;Reset&quot;>
</table>
<form>

I also tried putting the button outside the table, but it still doesn't work. Any ideas? Thanks.

Cheers,
alej
 
NEARLY self answered....any idea why this would give a syntax error?

function clearForm(formid)
{
var formElements = new Array();
formElements=document.getElementById(formid).elements;
for(x=0; x<formElements.length; x++) {
if (formElements[x].type !=&quot;button&quot;) {
formElements[x].value=&quot;&quot;;
}
}
}
thanks.

Cheers,
alej
 
Hi again...this looks more like a monologue ;-)
I found the mistake, or the solution. If I don't pass the menuID as a parameter and write directly the name in the function it works. It's enough for me like this, but anyway if somebody needs it, check adding quotations in getElementById(formid) could be something there.

Cheers,
alej
 
Just a thought.. but perhaps you would have found more input into your monologue if this was posted in javascript?

[hippy]





Tracey
Remember... True happiness is not getting what you want...

Its wanting what you have got!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top