File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes problem in forms.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem in forms.." Watch "problem in forms.." New topic

problem in forms..

Himanshu Rawat
Ranch Hand

Joined: Nov 27, 2005
Posts: 141
hi ppl,
the problem is like this..

I have a 2 fields in jsp page (text:- where user will enter something ,
and a menu from which it will select) and a link (click) below it.
These are not in a <html:form>. Is there any way when i click on link, values entered by the user in 2 fields should go to respective ActionForm classs where i can set the values and can further use in ActionClass.

plzz tell me how to do it??? urgently needed.


SCJP 1.4
poornima balagopal
Ranch Hand

Joined: Dec 02, 2003
Posts: 83
Since your fields are not there inside the <html:form> i dont think you will be able to get those in the respective action class using ActionForm.
If you want to get these values without keeping these fields inside <html:form> tag, have hidden fields for the same and get the values in the action class and set to the form object if there are properties to hold the values.
If you do this you can get these values in your next page using the form bean.
Himanshu Rawat
Ranch Hand

Joined: Nov 27, 2005
Posts: 141
thanx poornima...i finally did it...without using form did it dirty way...

used javascript for tat and called that form class...
I agree. Here's the link:
subject: problem in forms..
jQuery in Action, 3rd edition