• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Anchor tag to submit a form

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
AFAIK you should use "foo.bar.checked = true" to set checkboxes in JavaScript. This isn't really a Struts question, though.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hey David what do you mean by AFAIK ?
 
Songezo Nkukwana
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Viktor: Sorry! AFAIK == As Far As I Know.

@Songezo: I *did* provide a correction.
 
Songezo Nkukwana
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
What's wrong? Where are you going? Stop! Read this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic