This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
I want to enable submit button only when i check the checkbox
rahul jadeja
Greenhorn
Joined: Oct 15, 2009
Posts: 11
posted
0
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
Joined: Sep 20, 2009
Posts: 14
posted
0
you have to use javascript
rahul jadeja
Greenhorn
Joined: Oct 15, 2009
Posts: 11
posted
0
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
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
Joined: Oct 15, 2009
Posts: 11
posted
0
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
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: I want to enable submit button only when i check the checkbox