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

how enable/disable form submit button

Status
Not open for further replies.

jartse

Programmer
Apr 10, 2002
15
FI
how enable/disable form submit button

when user enter site form submit button is disabled and he cannot send form before he has click some link or banner and then button enabled and user can send form
 
Don't put a submit button on the form. Use a regular button with an onclick action that points to a JavaScript function.

The function will use a variable (declared outside the function) to track the number of times the button had been clicked. If the button has never been clicked before, then it will validate the inputs. If the inputs are good, it will increment that above counter then invoke the submit method of the form.

Clicking a second time on the submit button will do nothing. The form cannot be submitted without valid inputs. ______________________________________________________________________
Perfection in engineering does not happen when there is nothing more to add.
Rather it happens when there is nothing more to take away.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top