By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,947 Members | 1,505 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,947 IT Pros & Developers. It's quick & easy.

Javascript functioncall

MarkoKlacar
Expert 100+
P: 296
Hi,

Can anyone shed some light on statements that look like this:

Expand|Select|Wrap|Line Numbers
  1. <html:submit onClick="varble = true; othervariable = false"/>
The code is from a .jsp page, other things you should know is that it uses Java, Struts and WLS.

Any help appreciated.

Marko
Sep 19 '08 #1
Share this Question
Share on Google+
5 Replies


iam_clint
Expert 100+
P: 1,208
What do you need to know about it?

Expand|Select|Wrap|Line Numbers
  1. <html:submit onClick="varble = true; othervariable = false"/>
  2.  
so <html:submit>

makes a submit button I can only assume

and onClick.. that means when the button is clicked it sets two global variables because the word var isn't infront of the variables.
Sep 19 '08 #2

MarkoKlacar
Expert 100+
P: 296
Hi,

I figured that much, problem is I can't seem to find the variables declared anywhere...

Is that type of call common?

/MK
Sep 22 '08 #3

P: 93
The code tells about the Html struts tags.To include it in the jsp we need to write
Expand|Select|Wrap|Line Numbers
  1. <%@ taglib uri="/tags/struts-html" prefix="html" %>
now as per the attributes here
These codes usually works in the server side as you have to define actions related means when you submit the form
Sep 22 '08 #4

gits
Expert Mod 5K+
P: 5,390
those variables are set onclick of the submit button and should be accessible globally from javascript until the page is submitted ... because this will reload the page unless there is any other code that avoids the submit.

while the onclick is common i would say the use of globals is common for beginners and should be avoided whenever possible ...

kind regards
Sep 22 '08 #5

MarkoKlacar
Expert 100+
P: 296
Hey guys,

Thanks for you helpful responses, I think I get it now.

Thanks,
Marko
Sep 22 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.