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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reset button not refreshing

Status
Not open for further replies.

annasue

Technical User
Mar 20, 2004
21
0
0
US
I know this should be a piece of cake but I've looked at the code until I'm foggy-eyed and can't see my problem; maybe a fresh pair of eyes can spot the problem.

I have two php pages; I "think" I have identical code on the reset button for both but cannot get it to refresh the fields to empty on one.

- works
- doesn't work

AND, what is weird is that the submit button right above it works just fine!

Thanks in advance.
 
Sorry, you get their through register.php - try registering there and when you use the submit button, it displays register2.php.
 
The second page is drawn with the values of the various fields SET to the values entered on the first page. When you use a RESET button, it's job is to reset the values to the VALUE attribute of the various fields.

Try leaving a field blank on the first form then see what happens when you enter something in the same field on the second form and hit 'clear.' It clears.

Try changing a value that is auto-entered in the second form and his 'clear.' It resets to the original value.

If you really want it to CLEAR the form, then change the 'type=reset' to 'type=button' and add an onClick event to call a JavaScript function that actually CLEARS the form (sets the values of the various elements to '').

'hope that helps.

--Dave
 
Your reset button does work on both pages, on the second page it just resets the values to the original ones -- which is not blank but what user filled on the first page. If you want to make a button to clear the fields instead of reset them to their original value, you'll have to write one in JavaScript. Try asking in that forum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top