开发者

Populate hidden field with post data from checkbox (multiselect) in JSP (or JSTL)

开发者 https://www.devze.com 2023-03-08 14:34 出处:网络
I have a checkbox on page1.jsp that has more values: <input type=\"checkbox\" name=\"contactID\" value=\"1\" />

I have a checkbox on page1.jsp that has more values:

<input type="checkbox" name="contactID" value="1" />
<input type="checkbox" name="contactID" value="2" />
<input type="checkbox" name="contactID" value="3" /> etc.

I do post through a form, and on the next page2.jsp i have:

    // below line fails
    <input type="hidden" name="contactID" value="${param.contactID}" />   
    You have selected 2 people:
    - Name1 
    - Name2

    Select a newsletter for them:
    {select}

    <button>Subscribe</>

Then on the third page, i want the same thing as i got here, because i like to subscribe all selected contacts to the newsletter. I cant use one page, because i also have other operations to the selected contacts (send email, send sms, subscribe to this and that etc开发者_StackOverflow中文版).

0

精彩评论

暂无评论...
验证码 换一张
取 消