ponder275
ponder275

Reputation: 935

What is the id attribute for the struts <s:form > tag used for?

The struts documentation just says it is the HTML id attribute. I keep putting it on my pages because it was used on the example pages I based my code on but I don't see that I am using it. If I don't need it I could make my code cleaner by taking it out but I don't want to break code that works. I know the HTML id is used with CSS and JavaScript, is that why I need it? Any help would be appreciated!

Upvotes: 0

Views: 1164

Answers (1)

Roman C
Roman C

Reputation: 1

Yes the id attribute of s:form tag is used for generated HTML form tag. Read Struts2 doc for the definition of the id attribute

Name: id
Required: false
Default:
Evaluated: false
Type: String
Description: HTML id attribute

if the form has id attribute, keep the value as is, it could be used by JavaScript, CSS, other Struts tags.

Upvotes: 2

Related Questions