0 Replies - 481 Views - Last Post: 12 July 2011 - 08:13 AM

#1 lunixer   User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 120
  • Joined: 29-January 10

javascript variable in jsp code?

Posted 12 July 2011 - 08:13 AM

Hi. I am currently working with a jsp project that involves the code below. I am trying to make it so that when the button in the first section is pressed, the conditional in the second section will be true, so the text will appear. It seems simple enough, but the problem that I am having is that I just can't figure out how to coordinate the javascript code. Obviously I can do an onclick="javascript:somevariable=true" as a button condition, but I can't figure out how to set or declare this variable, or get the c:if to take a javascript variable, since everything else is jsp. Any suggestions?

	                      <td colspan="2" align="center">
								<button class="ur_button"  type="submit"
	                               >Save Account</button>	                     


	                      <!-- Code below added by Ross -->
						<!-- add js variable that gets modified onclick, make that the condition below -->
						<c:if test="${Some condition}">
                           <font color="red">
                   <!-- End code added by Ross -->

Is This A Good Question/Topic? 0
  • +

Page 1 of 1