javascript - how to pass parameter in action tag? -
I want to pass the res
variable as a form action. Is it possible with HTML?
& lt; Script & gt; Var name = $ ("#name"). Val (); Var file = $ ("# file"). Val (); Var res = localhost: 8080 + "/ test / reg? And name =" + name + "& amp; file =" + file; & Lt; / Script & gt; & Lt; Form action = "res" id = "form" method = "post" enctype = "multipart / form-data" & gt; Name: & lt; Input type = "text" name = "name" id = "name" /> Upload: & lt; Input type = "file" name = "file" id = "file" /> & Lt; / Form & gt; . Document.forms ["form"] submission ();
Set the action property before submitting it:
Comments
Post a Comment