• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to use onsubmit command

 
Ranch Hand
Posts: 39
IBM DB2 jQuery Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sir/Ms,

Please kindly advise how to use onsubmit command.
this is my coding


After the data update to DB, the window screen just close.

Please kindly advice.

Thanks and Best Regards
Sharon
 
Sheriff
Posts: 7134
1360
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What exactly do you want to accomplish? Are you trying to close the window after submission or what?
 
Sharon Wong
Ranch Hand
Posts: 39
IBM DB2 jQuery Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i want to close the window after submission.
But my button type ="button", don't want use "submit"


Thanks
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Remove the Java code from your JSP and use JSTL and EL. Java scriptlets have been obsolete for over 13 years.

Do not use Hungarian notation for naming things in JavaScript. That's not the convention and makes your code hard to read (and makes you look foolish).

Use jQuery to keep the JavaScript tidy and make sure that it works correctly across all browsers.

Submit buttons should be of type "submit", why is it not?

Why do you want to close the window? That seems really unfriendly.
 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"onsubmit" isn't a command, it's an event. And I don't see any onsubmit's in your code samples. The closest thing I see is "onclick" event handlers.

Incidentally, in case Bear hasn't completely demolished your self-confidence, I think use of the "javascript:" prefix for event handlers has been obsolete for many years. I think you may be working from a seriously out-of-date code sample. Software is not "forever", no matter what some people think.

It is rude to close windows, though. It's even ruder to pop up new windows. Sites that do that had better not be planning on selling me anything. I'll go find a competitor that's better behaved. Same with gratuitous Flash (a certain well-known automobile manufacturer lost a major sale to me that way). Or IE-only operation.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic