javascript - pass input value from one form to another form at same jsp page -
I have two forms in my jsp page, the first form has an input value and the other form The button is submitted, I can not use both forms due to some issue. Now I want to access the first form value in another form . My sample code is here, I need to access a first form value for the second form at Submit . Is there any way to use it? Thank you. I do not know exactly what you want to do. But you can not send a form data using another form using the submit button. You can talk one thing either using the session or you can use hidden fields in which there is a submit button. You can pass the values from the first form to the hidden fields of another form. Can use javascript / jquery for Then you can submit the form. Otherwise you can use the easiest session. IN Jquery This is jsfiddle for
& lt; Form name = "orange" id = "before" & gt; & Lt; Div & gt; & Lt; Input type = "article" name = "n1" & gt; & Lt; / Div & gt; & Lt; Select onchange = "document.forms ['onchange']. Submit ();" Name = "select" & gt; & Lt; Option value = "A" & gt; A & lt; / Options & gt; & Lt; Option value = "A" & gt; A & lt; / Options & gt; & Lt; / Form & gt; & Lt; Form action = "servlet" id = "seconds" & gt; & Lt; Input type = "submit" name = "sub" value = "submit" & gt; & Lt; / Form & gt;
& lt; Forms & gt; & Lt; Input type = "text" class = "input-text" value = "" size = "32" name = "user_data [first name]" id = "elm_6" & gt; & Lt; Input type = "text" class = "input-text" value = "" size = "32" name = "user_data [lastname]" id = "elm_7" & gt; & Lt; / Form & gt; & Lt; Form action = "#" & gt; & Lt; Input type = "text" class = "input-text" value = "" size = "32" name = "user_data [b_firstname]" id = "elm_14" & gt; & Lt; Input type = "text" class = "input-text" value = "" size = "32" name = "user_data [s_firstname]" id = "elm_16" & gt; & Lt; Input type = "submit" value = "continue" name = "send [checkout.update_steps]" & gt; & Lt; / Form & gt; Val ($ ('# elm_6'). Val ()); $ ('# Elm_16'). Val ($ ('# Elm_7'). Val ());});
Comments
Post a Comment