Skip to main content
added 2 characters in body
Source Link
user229044
  • 240.9k
  • 41
  • 347
  • 350

First have a button with type submit as

<INPUT<input TYPE="SUBMIT"type="submit" VALUE="SUBMIT"value="submit" /> 

In your FORMform tag, include the onSubmitonsubmit() event as

<FORM <form ACTION="action="/path/to/server/side/script" NAME="testform"name="testform" onSubmit="returnonsubmit="return validate()" > 

The validate() function should return true if the form validation goes through or a false if the validation fails. e.g.

function validate(){ if(...){//valid return true; }else{//not valid return false; } } 

EDIT: Always specify the button type. If not specified, in IE it defaults to "button" while in Chrome and Firefox it defaults to "submit".

<form action="my/script" onsubmit="return ValidateFunc();"> <button type="submit"> <img src="image/do_this_with_input_tag.png"> Some Text </button> </form> 

And in future, include more details in your question if you want proper answers.

First have a button with type submit as

<INPUT TYPE="SUBMIT" VALUE="SUBMIT"/> 

In your FORM tag, include the onSubmit() event as

<FORM  ACTION="/path/to/server/side/script" NAME="testform" onSubmit="return validate()" > 

The validate() function should return true if the form validation goes through or a false if the validation fails. e.g.

function validate(){ if(...){//valid return true; }else{//not valid return false; } } 

EDIT: Always specify the button type. If not specified, in IE it defaults to "button" while in Chrome and Firefox it defaults to "submit".

<form action="my/script" onsubmit="return ValidateFunc();"> <button type="submit"> <img src="image/do_this_with_input_tag.png"> Some Text </button> </form> 

And in future, include more details in your question if you want proper answers.

First have a button with type submit as

<input type="submit" value="submit" /> 

In your form tag, include the onsubmit() event as

<form action="/path/to/server/side/script" name="testform" onsubmit="return validate()" > 

The validate() function should return true if the form validation goes through or a false if the validation fails. e.g.

function validate(){ if(...){//valid return true; }else{//not valid return false; } } 

EDIT: Always specify the button type. If not specified, in IE it defaults to "button" while in Chrome and Firefox it defaults to "submit".

<form action="my/script" onsubmit="return ValidateFunc();"> <button type="submit"> <img src="image/do_this_with_input_tag.png"> Some Text </button> </form> 

And in future, include more details in your question if you want proper answers.

added 402 characters in body
Source Link
Suresh Kumar
  • 11.8k
  • 10
  • 47
  • 57

First have a button with type submit as

<INPUT TYPE="SUBMIT" VALUE="SUBMIT"/> 

In your FORM tag, include the onSubmit() event as

<FORM ACTION="/path/to/server/side/script" NAME="testform" onSubmit="return validate()" > 

The validate() function should return true if the form validation goes through or a false if the validation fails. e.g.

function validate(){ if(...){//valid return true; }else{//not valid return false; } } 

EDIT: Always specify the button type. If not specified, in IE it defaults to "button" while in Chrome and Firefox it defaults to "submit".

<form action="my/script" onsubmit="return ValidateFunc();"> <button type="submit"> <img src="image/do_this_with_input_tag.png"> Some Text </button> </form> 

And in future, include more details in your question if you want proper answers.

First have a button with type submit as

<INPUT TYPE="SUBMIT" VALUE="SUBMIT"/> 

In your FORM tag, include the onSubmit() event as

<FORM ACTION="/path/to/server/side/script" NAME="testform" onSubmit="return validate()" > 

The validate() function should return true if the form validation goes through or a false if the validation fails. e.g.

function validate(){ if(...){//valid return true; }else{//not valid return false; } } 

First have a button with type submit as

<INPUT TYPE="SUBMIT" VALUE="SUBMIT"/> 

In your FORM tag, include the onSubmit() event as

<FORM ACTION="/path/to/server/side/script" NAME="testform" onSubmit="return validate()" > 

The validate() function should return true if the form validation goes through or a false if the validation fails. e.g.

function validate(){ if(...){//valid return true; }else{//not valid return false; } } 

EDIT: Always specify the button type. If not specified, in IE it defaults to "button" while in Chrome and Firefox it defaults to "submit".

<form action="my/script" onsubmit="return ValidateFunc();"> <button type="submit"> <img src="image/do_this_with_input_tag.png"> Some Text </button> </form> 

And in future, include more details in your question if you want proper answers.

Source Link
Suresh Kumar
  • 11.8k
  • 10
  • 47
  • 57

First have a button with type submit as

<INPUT TYPE="SUBMIT" VALUE="SUBMIT"/> 

In your FORM tag, include the onSubmit() event as

<FORM ACTION="/path/to/server/side/script" NAME="testform" onSubmit="return validate()" > 

The validate() function should return true if the form validation goes through or a false if the validation fails. e.g.

function validate(){ if(...){//valid return true; }else{//not valid return false; } }