tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zabel, Ian" <IZa...@cirqit.com>
Subject [OFF TOPIC] RE: To capture the CLICK event of SUBMIT button
Date Tue, 08 Oct 2002 14:48:07 GMT
It would certainly be easier to answer this question with a sample of your
code, but I will run through some basic javascript techniques you may be
able to use.

You can make an HREF submit a form:

<script>
function doSubmit() {
	document.forms[0].hiddenField.value = 'test!'
	document.forms[0].submit()
	return true
}
</script>
<form action="nextpage.jsp">
<a href="javascript:doSubmit()">Click here to set value and submit form</a>

<input type="hidden" name="hiddenField">
</form>

When you click on the link on this snippet of code, it will call doSubmit()
which sets the value of the hidden field, and then submits the form to
nextpage.jsp. Hopefully this will give you some ideas.

Some good resources:
http://www.faqts.com/knowledge_base/index.phtml/fid/53
http://javascript.internet.com/

Ian.


-----Original Message-----
From: Nagpal, Vikas [mailto:vinagpal@utmb.edu]
Sent: Tuesday, October 08, 2002 10:30 AM
To: 'tomcat-user@jakarta.apache.org'
Subject: To capture the CLICK event of SUBMIT button


Hello Everybody,

I have been trying to accomplish two jobs simultaneously. First on the CLICK
of my ANCHOR tag I want to assign some value to the HIDDEN input tag and
simultaneously carry this value to the page linked to HREF element of this
ANCHOR tag.

Till this point of time its a two CLICK process(Using JAVASCRIPT FUNCTION):

1) I CLICK on my HREF element and it assigns some value to the HIDDEN input
tag.

2) Then I CLICK on the SUBMIT button and it carries the value assigned to
the HIDDEN input tag to the page linked to the HREF element of the ANCHOR
tag.

Can i make this a single CLICK process by capturing CLICK event of the
SUBMIT button on the onClick event of my ANCHOR tag. Can I make this single
step process.

Thanks in advance,
With regards,
Vikas nagpal.

 
 

--
To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message