Several Methods for passing JSP page values

Source: Internet
Author: User
Tags bbcode

1. Hide the field transfer value:

<Form method = "Post" Action = "client_crud.jsp">
<Input type = "hidden" name = "ID" value = "<% = ID %>">

2. url transfer value:
Use button

A.
<Input name = "btnmodify" type = "button" class = "button1" onclick = "self. Location = 'client _ modify. jsp? Id = <% = ID %> '"
Value = "Modify distributor"/>
B. Set the onclick = "modifyregion ()" of input ()"
Function modifyregion (){
Window. Self. Location = client_node_modify.jsp? Id = <% = ID %> ";
}

3. Pass values in JS Mode

// Obtain the form object submission form
With (document. getelementbyid ("userform ")){
Method = "Post ";
Action = "user_add.jsp? Command = Add ";
Submit ();
}
 
Function searchitem (){
With (document. Forms [0]) {
Action = "Servlet/basedata/searchitemservlet ";
Method = "Post ";
Submit ();
}
}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.