Results 1 to 6 of 6
- 02-22-2011, 06:26 PM #1
Senior Member
- Join Date
- Feb 2009
- Posts
- 117
- Rep Power
- 0
a little question about on the sequence of actions done by a servlet
hi thanks for reading.
I just would like to know what executes when you have an html button inside a form.?
and this is how my button is written
this piece of button is inside a form. and the container form has an action point to a servlet. now my question is, because there is an onclick action too here. what triggers first?Java Code:<input type = "submit" onClick="jScriptMethod()" value="Edit">
when I click a button, does it do the onclick method first? or does it submit the form data straight to the servlet? thanks!
all answers would be appreciated, thank you :D
- 02-23-2011, 08:59 AM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Not actually a Java question, but...the onClick fires first. It's often used to validate a form prior to actually submitting.
- 03-31-2011, 11:36 AM #3
Member
- Join Date
- Mar 2011
- Posts
- 16
- Rep Power
- 0
First your onClick="jScriptMethod()" will be called and then form will be submitted.
- 03-31-2011, 12:15 PM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Are you just going to repeat answers already given...in old threads?
Anyone would think you were simply trying to get your post count up...
- 04-06-2011, 11:15 AM #5
Member
- Join Date
- Mar 2011
- Posts
- 22
- Rep Power
- 0
onclick is fired first then servlet action
- 04-06-2011, 11:19 AM #6
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Similar Threads
-
Servlet Mapping question.
By Mega Man X in forum Java ServletReplies: 2Last Post: 02-17-2010, 02:15 PM -
Linked list sequence and array sequence
By Predz in forum New To JavaReplies: 1Last Post: 12-31-2009, 01:30 AM -
Question regarding url-pattern in Servlet
By basark in forum Java ServletReplies: 1Last Post: 09-06-2008, 01:05 PM -
Servlet Question
By sandor in forum Java ServletReplies: 5Last Post: 12-19-2007, 11:27 AM -
Servlet question
By Peter in forum Java ServletReplies: 2Last Post: 07-04-2007, 01:34 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks