/    Sign up×
Community /Pin to ProfileBookmark

HTML form: Add parameters to action value

Hello,
In a Struts2 form I have something like this:

[CODE]
<s:form action=”myForm_view” name=”MyForm” >
<s:textfield name=”searchPhrase”/>
…..
</s:form>
[/CODE]

When something is entered in textfield and you hit enter key, the form submits to myForm_view.action. How do I add a parameter to the action in this case? I need something like myForm_view.action?arg=1.

Please help. Thanks in advance.

to post a comment
HTML

1 Comments(s)

Copy linkTweet thisAlerts:
@FangNov 24.2010 — [CODE]<input type="hidden" name="arg" value="1">[/CODE]
×

Success!

Help @Gameone spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...