aspose file tools*
The moose likes Struts and the fly likes problem with html:form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem with html:form" Watch "problem with html:form" New topic
Author

problem with html:form

Saathvik Reddy
Ranch Hand

Joined: Jun 03, 2005
Posts: 228
Hi,

I have this code in my JSP page. I need to have name = "questionList" for the form becoz i am using java script
if(document.questionList.yesno1.options[1].selected)... in the JSP page.

<html:form action = "/questions.do" name="questionList" type="gov.osc.vendrep.webapp.form.impl.QuestionForm" >

but i get Attribute name invalid for tag form according to TLD error.
Please help me...

Thanks in advance,
dnyan ginde
Ranch Hand

Joined: Jan 17, 2006
Posts: 68
Hello cs Reddy,

You need not mention the name attribute at all. This is what you can do:
1)Your struts config will be something like this:

2)now in your jsp you can do something like this:

3)in your javascript you can do this:
document.loginForm.blah.blah = blah;

The form name is automatically taken to be loginForm which is what you mentioned in your struts-config.xml.

Hope this solves your problem.
[ February 22, 2006: Message edited by: dnyan ginde ]
Saathvik Reddy
Ranch Hand

Joined: Jun 03, 2005
Posts: 228
Thanks dnyan for your reply. I have another question

If i am using simple html tags then i do
<input type="radio" name="radiobtns" value="abc" onklik="show('layer1')"<
which works fine.
but if i want to use struts html tags and if i use
<html:radio property = "radio" value = "<=%qvalue%<" onklik="show('layer1')"/<
Then it throws this error

Attribute onClick invalid for tag radio according to TLD

I am not sure how to call javascript onClick of radio btn. Please help me.

Thanks in advance,
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1018
The attribute is not "onClick". it is "onclick" (note lower case c)
http://struts.apache.org/struts-doc-1.2.x/userGuide/struts-html.html#radio

Case doesn't matter when you are dealing with HTML tags.
It DOES matter when dealing with custom tags in JSP.

Cheers,
evnafets
Saathvik Reddy
Ranch Hand

Joined: Jun 03, 2005
Posts: 228
Thanks a Lot!!!
It worked
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with html:form