• 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

Naming an html:form tag

 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the attribute name, this is the JavaBean name, not the name to give to the Form on the Web Page. I want to name the form so that I can use the suggestion here, for creating a Save link outside of the form.
Thanks
Mark
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's also the name given to the form on the html page.
Try using the name attribute and then viewing the source on your page. The html should have the name attribute same as what you listed in the struts tag.
 
Mark Spritzler
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Marc.
But then it will try to find a JavaBean that probably doesn't exist. Right?
Mark
 
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
According to the latest API docs, the <html:form> doesn't have a name attribute. It decides which form bean to use based on the form bean used by the Action specified in the action attribute.
[ April 23, 2004: Message edited by: Jason Menard ]
 
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might be able to use the styleId parameter which renders an id attribute. I'm pretty sure you can get a reference to a document element using the id. Your save link would then be a call to a JavaScript function that finds the form element with a particular id value and submit it. Also make sure you don't have any elements in your page that are named "submit" because that can interfere with your ability to call the JavaScript form.submit method.
something like
<a href="javascript:submitFormWithId('<bean:write name="id">')">Save</a>
<html:form action="myAction" styleId="${id}">
reply
    Bookmark Topic Watch Topic
  • New Topic