This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes ActionForm doesn't set value from HTML form! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "ActionForm doesn Watch "ActionForm doesn New topic
Author

ActionForm doesn't set value from HTML form!

s basetti
Greenhorn

Joined: Jun 16, 2002
Posts: 14
Guys,
This is eating my time. In my HTML form, I have fields by a same name like 'event' like following:

=====================================================
<html:hidden name="resultsForm" property="event"/>
<td><html:submit styleClass="buttonTextSmall" property="event" value="Submit"/></td>
<td><html:submit styleClass="buttonTextSmall" property="event" value="Clear"/></td>
===========================================

When I submit the form on following(when using drop-down only) doens't set 'event' attribute on action form :
===============================
<html:select styleId="C2" styleClass="inputCell" property="criteria2" onchange="return c2change(this.form);">
<html: options collection="criteriaList" property="value"
labelProperty="label" /></html:select>
===============================

javascript call from above is:
===============================
function c2change(form)
{
var slctdVal = document.getElementById("C1").value;
form.event.value = "Redraw";
form.submit();
return true;

}
===============================

I think the problem is due to Request object considering as field arrays.

As we know, But same thing works on button, when i click submitting correct button value into action form attribute 'event'.

What is the best alternative in approaching solution to this? BUT having 'EVENT' as the field only for all fields.

thanks for your time in advance.
s basetti
Greenhorn

Joined: Jun 16, 2002
Posts: 14
Is there someone who faced this problem and found better alternative?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: ActionForm doesn't set value from HTML form!
 
Similar Threads
This is for BEAR Bear Bibeault
STRUTS - Action form doesn't set for array
Form Params not passed properly
Editing and submitting multiple records
obtaining parameters of hidden fields combined with multiple form tags