aspose file tools*
The moose likes Struts and the fly likes Anchor tag to submit a form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Anchor tag to submit a form" Watch "Anchor tag to submit a form" New topic
Author

Anchor tag to submit a form

Songezo Nkukwana
Ranch Hand

Joined: Nov 27, 2008
Posts: 51
Hi, i have a tile nav.jsp which has two links...



The form qualsForm a checkbox (mutlibox) which i would like to submit all the checked boxes after i press the above links ... Currently, no data on checkboxes is passed to my Action class .. My form object has a property getCheckedItems which returns an array of checked items .. In my Action class i use this method to get what's checked, and it returns null
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

AFAIK you should use "foo.bar.checked = true" to set checkboxes in JavaScript. This isn't really a Struts question, though.
Victor Hou
Greenhorn

Joined: Dec 16, 2008
Posts: 4
hey David what do you mean by AFAIK ?


Just knowing<br /> <br />I am start Learning English now.
Songezo Nkukwana
Ranch Hand

Joined: Nov 27, 2008
Posts: 51

AFAIK you should use "foo.bar.checked = true" to set checkboxes in JavaScript. This isn't really a Struts question, though.


Seems my question is not clear ... I have to JSP files (Navigation.jsp & QualsForm.jsp) ... QualsForm has checkboxes (multibox) which the user will select.. I will read the selected checkboxes into an array of strings inside the Action class when the form is submitted. If i add a submit button in my QualsForm, the checked boxes gets submitted successfully .. But if i use the hyperlink in Navigation.jsp to submit QualsForm.jsp, the string array form property is always empty ... The code i provided is how i did it was hoping for corrections
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

@Viktor: Sorry! AFAIK == As Far As I Know.

@Songezo: I *did* provide a correction.
Songezo Nkukwana
Ranch Hand

Joined: Nov 27, 2008
Posts: 51
Sorry for my blindness, where's the correction? You only suggested i should check the boxes in Java Script but that's not what i want to do...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Anchor tag to submit a form