JavaScipt

Soldato
Joined
2 Oct 2003
Posts
2,849
Location
MI5 | Thames House
Trying to use a Img instead of the crappy look grey button code 1 work's fine but my code in 2 doesnt any ideas, sorry inadvance ;) . Iv'e googled and my code looks fine:confused:

1
Code:
<tr><td><center><input type="button" value="Login" onClick="pasuser(this.form)">
2
Code:
<tr><td><center><input type="image" img src="login.png" onClick="pasuser(this.form)">
 
Last edited:
The problem is because the input type="image" will submit the form before it runs any code you put in the onclick handler, and because the form submission causes a redirect, the onclick code will never be run.

You either need to change the input to an image with the click handler on it (and make sure you also call form.submit() in there), or remove the click handler from the image input and add an onsubmit handler to the form.

sorted thanks for the help m8 , :D
Code:
<a href="JavaScript:pasuser(form)"> <img src="login.png"</a>
 
Last edited:
Back
Top Bottom