This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Hands On Software Engineering with Python and have Brian Allbey on-line!
See this thread for details.
Win a copy of Hands On Software Engineering with Python this week in the Jython/Python 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Naming an html:form tag  RSS feed

 
ranger
Posts: 17344
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
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
Posts: 17344
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: 12815
211
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}">
 
expectation is the root of all heartache - shakespeare. tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!