Two methods of passingtake the checkbox value

xiaoxiao2021-03-06  62

Two ways to take the checkbox value [finishing during work]:

As page A is passed to page B..

Example

1:

Page A Definition

<% for (int i = 0; i <10; i ) {%>

<%}%>

Page B Value

String [] msgid = Request.getParameterValues ​​("msgid");

Save to an array

2:

Page A Definition

<% for (int i = 0; i <10; i ) {%>

<%}%>

VAR IDS = ""

For (i = 0; i

{

IF (form1.msgid [i] .checked == true) IDS = IDS FORM1.MSGID [i] .value ",";

}

Document.all.form1.msgids.value = IDS;

IF (ids.indexof (",") <0)

{

Alert ("Please select At least one message");

Return False;

}

Form1.action = "del_reced.jsp";

Document.form1.submit ();

}

->

Page B Value

String [] msgid = Request.getParameterValues ​​("msgid");

Save to an array

Page B Value

String msgid = Request.getParameterValues ​​("MSGID");

Then split.

Zhuo Wang's platform is the second method, the advantages and disadvantages are not clear

转载请注明原文地址:https://www.9cbs.com/read-84735.html

New Post(0)