javascript - Form with multiple submit buttons that queries external website -


hi need write code form queries external website 3 submit buttons. , each submit button send common input fields , related specific individual bodies. believe need use javascript not sure can it. below structure of form.

<form action="external website" method="post"> {{ form_with common input selectors }}  <!-- if submit option 1 used --> <input type="text" name="fixed" value="option one">  <!-- if submit option 2 used --> <input type="text" name="fixed" value="option two">  <!-- if submit option 3 used --> <input type="text" name="fixed" value="option three">  <input type="submit" name="option one" value="option one" /> <input type="submit" name="option two" value="option two" /> <input type="submit" name="option three" value="option three" /> </form> 

any experts appreciated!

bests

if understand question correctly answer. sending 1 of 3 values part of form seems you're asking for.

the question vague though may not help.

<!-- 1 input field needed --> <input id="something" type="text" name="fixed" value="">   <input type="submit" name="option one" onclick="firstbutton();" value="option one" /> <input type="submit" name="option two" onclick="secondbutton();" value="option two" /> <input type="submit" name="option three" onclick="thirdbutton();" value="option three" /> </form>  <script type="text/javascript"> var input1 = "whatever input 1 be"; var input2 = "whatever input 2 be"; var input3 = "whatever input 3 be"; function firstbutton() { document.getelementbyid('something').value = input1; } function secondbutton() { document.getelementbyid('something').value = input2; } function thirdbutton() { document.getelementbyid('something').value = input3; } </script> 

Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -