Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in html:text /html:text input tag

 
mohsin sheikh
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
i am developing a project in struts.I have created a form that accepts date from user.I want a default value in date field i.e todays date.I am using
Create Date:<html:text property="createdate"> </html:text>
now when i am using "value" attribute in the above tag, then it is giving error.So tell me which attribute in the above tag should be used which will replace value attribute used in <input> tag.I want default value in create date tag as system date
 
Brent Sterling
Ranch Hand
Posts: 948
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What error did you get? It might be that you cannot have both a value and an ending tag. I did not see any mention in the document that I looked at but I would not be surprised if it uses the body of the tag as the value. Rather than set a default value in the JSP, I would rather set a default value in the form. In your example, if you set a default value for the createdate property then that will be shown with the page is displayed.

- Brent
 
Maya Thomas
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think setting the value attribute should produce an error.But, if you do want to initialize form fields, you could always do it in the Action class by setting the Actionform property for which you want to show the default. On other hand, you would have to use scriptlets if you do it from the JSP.

-Maya
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic