This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Naming an html:form tag  RSS feed

 
ranger
Sheriff
Posts: 17314
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • 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
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • 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
Sheriff
Posts: 17314
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • 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
  • 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: 12318
200
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • 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}">
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!