aspose file tools*
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: 1164
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: 1164
Here are the code segments -
Works -

Doesn’t work -
Dan Drillich
Ranch Hand

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

Joined: Oct 21, 2000
Posts: 4339
    
    2

perhaps the problem is in the function


SCJP
Visit my download page
Dan Drillich
Ranch Hand

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

Thanks,
Dan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: input type=image with JS
 
Similar Threads
Strange - Page Submits!!!
Limit on Data/Key-Value Pairs in Form Submission
from is getting submitted when 'Refresh' button is clicked
How to submit form with return
form is getting submitted when 'Refresh' button on the browser is clicked.