This week's book giveaway is in the iOS forum.
We're giving away four copies of Classic Computer Science Problems in Swift and have David Kopec on-line!
See this thread for details.
Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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: 11825
193
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}">
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!