| Author |
creating dynamic text box on button click using action classes not javascript
|
osheen maen
Greenhorn
Joined: Jan 13, 2012
Posts: 4
|
|
I want to add text boxes when user clicks on add button .I have searched on Google .But i found the code using JavaScript .I don't want to do this using java script
I want to do this by using action class and struts .i just want to avoid java script .any one can help me .
|
 |
Akhilesh Trivedi
Ranch Hand
Joined: Jun 22, 2005
Posts: 1351
|
|
"...using action classes not javascript"
Any specific reason? Why would you want to hit server ?
|
Keep Smiling Always — My life is smoother when running silent. -paul
[FAQs] [Certification Guides] [The Linux Documentation Project]
|
 |
Bear Bibeault
Author and opinionated walrus
Marshal
Joined: Jan 10, 2002
Posts: 50691
|
|
Seems like a silly thing to do. But you'll need to redisplay the page with the new control added.
JavaScript is the correct tool for this job -- why do you want to avoid it?
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
osheen maen
Greenhorn
Joined: Jan 13, 2012
Posts: 4
|
|
|
Because we can disable java script and also i want to know how to do this using action classes .i any one know please tell me .Thank you
|
 |
Bear Bibeault
Author and opinionated walrus
Marshal
Joined: Jan 10, 2002
Posts: 50691
|
|
cool osheen wrote:i want to know how to do this using action classes
Already answered. When the page is redisplayed as the response of the action, add the new elements to the page. What part of that are you having problems with?
|
 |
osheen maen
Greenhorn
Joined: Jan 13, 2012
Posts: 4
|
|
|
I didn't get your answer.please elaborate it .Anyways thank you replying. please tell me using an example if you can .
|
 |
Bear Bibeault
Author and opinionated walrus
Marshal
Joined: Jan 10, 2002
Posts: 50691
|
|
|
No I will not write the code for you. What part do you not understand? If you can't even figure out what it is you need to know, maybe you're not quite ready to tackle this task.
|
 |
osheen maen
Greenhorn
Joined: Jan 13, 2012
Posts: 4
|
|
i just want to know that why this code is not working .
<s:submit name="addMore" value="+Add More" onclick="this.form.add(<s:textfield />)"></s:submit>
when we are able to change the action of the form like this
<s:submit name="Message" onclick="this.form.action='Helllo'></s:submit>
then we can add a new control in the form .please help to understand the logic
|
 |
 |
|
|
subject: creating dynamic text box on button click using action classes not javascript
|
|
|