Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I want to enable submit button only when i check the checkbox

 
rahul jadeja
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey people
I want to enable my submit button only when the checkbox is checked..
Can you please tell me what modifications i have to do in <html:checkbox ......
and what all files do i have to change
I am new to struts
please help
thanks
 
nobeltr ozgur
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you have to use javascript
 
rahul jadeja
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi thanks for the reply
this is my checkbox..its in the jsp file
<html:checkbox property="receiveEmail"/><bean:message key="receiveEmail.label"/>
and the next part of the code is validation.xml
<field property="receiveEmail" depends="required, validwhen">
<arg0 name="test" key="receiveEmail.label"/>
<var>
<var-name>test</var-name>
<var-value>(*this* == "true")</var-value>
</var>
</field>

can you please help me in which file should i make changes and how
thanks
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This isn't a validation issue, it's a JavaScript issue. You need to write a JavaScript function that enables the submit button after the checkbox is checked.
 
rahul jadeja
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the reply..can you please help me out with the javascript code..also that in which file do i have to put that code or do i have to make a new javascript file
thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic