请问一个传值问题
<P>下面这个可以传过去<BR><script language="javascript" type="text/javascript">function submitbutton_reg() {<BR> var form = document.mosForm;<BR> var r = new RegExp("[\<|\>|\"|\'|\%|\;|\(|\)|\&|\+|\-]", "i");<BR>//shengguoyou <BR> // do field validation<BR> //if (form.name.value == "") {<BR> // alert( "<?php echo addslashes( html_entity_decode(_REGWARN_NAME) );?>" );<BR> //} else<BR> if (form.username.value == "") {<BR> alert( "<?php echo addslashes( html_entity_decode(_REGWARN_UNAME) );?>" );<BR> } else if (r.exec(form.username.value) || form.username.value.length < 3) {<BR> alert( "<?php printf( addslashes( html_entity_decode(_VALID_AZ09_USER) ), addslashes( html_entity_decode(_PROMPT_UNAME) ), 2 );?>" );<BR> }<BR> //else if (form.idcard.value == "") {<BR> //alert( "<?php echo addslashes( html_entity_decode(_REGWARN_IDCARD) );?>" );<BR> //}<BR> <BR> <BR> <BR> else if (form.email.value == "") {<BR> alert( "<?php echo addslashes( html_entity_decode(_REGWARN_MAIL) );?>" );<BR> } else if (form.password.value.length < 6) {<BR> alert( "<?php echo addslashes( html_entity_decode(_REGWARN_PASS) );?>" );<BR> } else if (form.password2.value == "") {<BR> alert( "<?php echo addslashes( html_entity_decode(_REGWARN_VPASS1) );?>" );<BR> } else if ((form.password.value != "") && (form.password.value != form.password2.value)){<BR> alert( "<?php echo addslashes( html_entity_decode(_REGWARN_VPASS2) );?>" );<BR> } else if (r.exec(form.password.value)) {<BR> alert( "<?php printf( addslashes( html_entity_decode(_VALID_AZ09) ), addslashes( html_entity_decode(_REGISTER_PASS) ), 6 );?>" );<BR> }<BR> <BR> //shengguoyou add<BR> else if (form.question.value == "") {<BR> alert( "<?php echo addslashes( html_entity_decode(_REGWARN_QUESTION) );?>" );<BR> }<BR> else if (form.answer.value == "") {<BR> alert( "<?php echo addslashes( html_entity_decode(_REGWARN_ANSWER) );?>" );<BR> }<BR> else {<BR> form.submit();<BR> }<BR> }<BR> </script><BR> <form action="index.php" method="post" name="mosForm"><BR> <?php $idcard=$_POST['idcard'];<BR> $name=$_POST['name'] <BR> ?><BR> <div class="componentheading"> <BR> <?php echo _REGISTER_TITLE; ?><BR> </div><BR> <table cellpadding="0" cellspacing="0" border="0" width="100%" class="contentpane"><BR> <tr><BR> <td colspan="2"><?php echo _REGISTER_REQUIRED; ?></td><BR> </tr><BR> <tr><BR> <td><?php echo _REGISTER_NAME; ?> * </td><BR> <td><input name="name" type="text" class="inputbox" id="name" value="<?php echo "$name"?>" size="40" maxlength="50" /></td><BR> </tr><BR> <tr><BR> <td><?php echo _REGISTER_IDCARD; ?> *</td><BR> <td><input name="idcard" type="text" class="inputbox" id="idcard" value="<?php echo "$idcard"?>" size="40" maxlength="100" /></td><BR> </tr><BR> <tr><BR> <td width="30%"><BR> <?php echo _REGISTER_UNAME; ?> * </td><BR> <td><BR> <input type="text" name="username" size="40" value="" class="inputbox" maxlength="25" /> </td><BR> </tr><BR> <tr><BR> <td><BR> <?php echo _REGISTER_EMAIL; ?> * </td><BR> <td><BR> <input type="text" name="email" size="40" value="" class="inputbox" maxlength="100" /> </td><BR> </tr><BR> <tr><BR> <td><?php echo _REGISTER_PASS; ?> * </td><BR> <td><input class="inputbox" type="password" name="password" size="42" value="" /> </td><BR> </tr><BR> <tr><BR> <td><?php echo _REGISTER_VPASS; ?> * </td><BR> <td><input class="inputbox" type="password" name="password2" size="42" value="" /> </td><BR> </tr><BR> <tr><BR> <td><?php echo _REGISTER_QUESTION; ?> *</td><BR> <td><input name="question" type="text" class="inputbox" value="" size="40" maxlength="100" /><BR> <?php echo _REGISTER_QUESTION1; ?></td><BR> </tr><BR> <tr><BR> <td><?php echo _REGISTER_ANSWER; ?> *</td><BR> <td><input name="answer" type="text" class="inputbox" value="" size="40" maxlength="100" /><BR> <?php echo _REGISTER_ANSWER1; ?></td><BR> </tr><BR> <tr><BR> <td colspan="2"> </td><BR> </tr><BR> <tr><BR> <td colspan=2> </td><BR> </tr><BR> </table><BR> <input type="hidden" name="id" value="0" /><BR> <input type="hidden" name="gid" value="0" /><BR> <input type="hidden" name="useractivation" value="<?php echo $useractivation;?>" /><BR> <input type="hidden" name="option" value="<?php echo $option; ?>" /><BR> <input type="hidden" name="task" value="saveRegistration" /><BR> <input name="button" type="button" class="button" value="<?php echo _BUTTON_SEND_REG; ?>" /><BR> <input type="hidden" name="<?php echo $validate; ?>" value="1" /><BR> </form></P><P>在同一页面 通过函数判断 这个为什么传不过去 <script language="javascript" type="text/javascript">function ChkFields() {<BR> var form = document.myform;<BR> var r = new RegExp("[\<|\>|\"|\'|\%|\;|\(|\)|\&|\+|\-]", "i");<BR> // do field validation<BR> if (form.name.value == "") {<BR> alert( "<?php echo addslashes( html_entity_decode(_REGWARN_NAME) );?>" );<BR> } else<BR> if (form.idcard.value == "") {<BR> alert( "<?php echo addslashes( html_entity_decode(_REGWARN_IDCARD) );?>" );<BR> } <BR> else {<BR> form.submit();<BR> }<BR> }<BR> </script><BR> <form action="index.php" method="post" name="myform" id="myform" ><BR> <div class="componentheading"></div><BR> <table cellpadding="0" cellspacing="0" border="0" width="100%" class="contentpane"><BR> <tr><BR> <td><?php echo _REGISTER_NAME; ?> * </td><BR> <td><input name="name" type="text" class="inputbox" id="name" size="40" maxlength="50" /></td><BR> </tr><BR> <tr><BR> <td><?php echo _REGISTER_IDCARD; ?> *</td><BR> <td><input name="idcard" type="text" class="inputbox" id="idcard" size="40" maxlength="100" /></td><BR> </tr><BR> <BR> </table><BR> <input type="hidden" name="option" value="<?php echo $option;?>" /><BR> <input type="hidden" name="task" value="saveRegistration1" /><BR> <input type="button" value="<?php echo _BUTTON_SEND_PASS1; ?>" class="button" /><BR> <input type="hidden" name="<?php echo $validate; ?>" value="1" /><BR></form></P>
页:
[1]
