GeeCON Prague 2014*
The moose likes HTML, CSS and JavaScript and the fly likes input type=image with JS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "input type=image with JS" Watch "input type=image with JS" New topic
Author

input type=image with JS

Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1180
My submit button is of input type and has a JS function in the onClick attribute.
The JS function submits the form when the function returns true, otherwise, the form is not submitted.
When I replace this button with an image the form is submitted even when the function returns false.
Any ideas?
Thanks,
Dan


William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1180
Here are the code segments -
Works -

Doesn’t work -
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1180
The dash in the on-Click was forced upon me by the Javaranch HTML disabler ;-(
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4347
    
    2

perhaps the problem is in the function


SCJP
Visit my download page
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1180
The solution is -

Thanks,
Dan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: input type=image with JS