How can the values of different forms be obtained together?
Source: Internet
Author: User
How can the values of different forms be obtained together? & Lt; METAcontent = 'text/html; charset = gb2312 'http-equiv = Content-Type & gt; & lt ;? Phpecho & quot; & nbsp; & lt; formname = form1mothod = GET & gt; & lt how can we GET the values of different forms together?
Echo"
";
?>
The code is as above; the problem is that after you click the submit button, you can only get the value of the form1 form. The value displayed in the form2 category is not obtained. if you delete onclick = \ "document. f1.submit (); return false; \ ", you can only get the value displayed in the form2 category but not the value of the check box in form1,
How can I get the value of 2 at the same time?
Because the function I want is to select the form1 option and then use the value of form2 to change the attributes in the form1 option. submitting is execution.
------ Solution --------------------
Write
Script
Function foo (){
Var input = document. createElement ('input ');
Input. type = "hidden ";
Input. name = "showtype ";
Input. value = document. form2.showtype. value;
Document. form1.appendChild (input );
Document. form1.submit ();
Return false;
}
Script
------ Solution --------------------
Print_r ($ _ POST );
------ Solution --------------------
Method = post
------ Solution --------------------
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.