Front-end technology-submit a form through javaScript, front-end javascript
window.location=pp+"?username="+getCookie("username")+"&userid="+getCookie("userid");
Replace
document.write("<form action="+pp+" method=post name=formx1 style='display:none'>");document.write("<input type=hidden name=username value='"+getCookie("username")+"' />");document.write("<input type=hidden name=userid value='"+getCookie("userid")+"' />");document.write("</form>");document.formx1.submit();
How to control the submission form in javascript
<Form name = "form" method = "post" action = "">
<Input type = "button" value = "delete" onClick = "delall ();" class = "button">
</Form>
<Script language = "javascript">
Function delall (){
If (confirm ('Are you sure you want to delete the selected consultation? \ N Note: it cannot be restored after deletion! ')){
This. form. action = "UserReview. asp? Action = delall "// set the Handler
This. form. submit (); // submit the form
}
}
</Script>
Note that the button is not submit.
If it is a submit, you must add onSubmit = "delall ()" to the <form tag ()"
How does JavaScript submit a form?
Html:
<Form name = "abc" id = ""
---------------
Js:
1. document. abc. submit ()
2. document. getElementById ("")
3. If there is only one form on the current page
Document. froms [0]. submit ()
4. document. froms ["abc"]. submit ()