Posts: 3
Threads: 2
Joined: Aug 2010
Reputation:
0
Hi everybody, and thanks for a superb script!
I have done a lot of experimenting and searching the forum but could not come up with an answer so I hope one of you can help me.
How do I set up multiple submit buttons on a page? ..
My front page has 3 different choices and it would be so much easier for the user to just click on the one they choose and then get directed to the next page. Without the need to fill up a checkbox and then click the submit. Is this possible?
Thanks
Posts: 3
Threads: 2
Joined: Aug 2010
Reputation:
0
Aug 23rd, 2010, 7:09 AM
(This post was last modified: Aug 23rd, 2010, 8:01 AM by villjam.)
Ok, not many answers, but maybe this example will help:
<?php
require_once("form_tool/global/api/api.php");
$fields = ft_api_init_form_page("", "test");
$params = array(
"submit_button" => "small_x",
"next_page" => "dildopresent_meddelande.php",
"form_data" => $_POST
);
ft_api_process_form($params);
?>
<form action="<?php echo $_SERVER["PHP_SELF"]?>" method="post">
<input name="small" type="image" id="small" tabindex="1" src="1_small.jpg" alt="Liten" align="left" />
<input name="medium" type="image" id="medium" tabindex="2" src="2_small.jpg" alt="Medium" align="middle" />
<input name="big" type="image" id="big" tabindex="3" src="3_small.jpg" alt="Stor" align="right" />
</form>
This will work, but only if I click the "small" image.. I can't come up with a way to make it work if I press any of the images. Any ideas?
Thanks
Solved it with javascript like this:
<?php
require_once("form_tool/global/api/api.php");
$fields = ft_api_init_form_page("", "test");
$params = array(
"submit_button" => "submit_x",
"next_page" => "dildopresent_meddelande.php",
"form_data" => $_POST
);
ft_api_process_form($params);
?>
<form action="<?php echo $_SERVER["PHP_SELF"]?>" method="post">
<input name="submit" type="image" src="1_small.jpg" alt="Liten dildo" align="left" onClick="javascript:document.forms[0].dildo.value = 'small';" />
<input name="submit" type="image" src="2_small.jpg" alt="Medium dildo" align="middle" onClick="javascript:document.forms[0].dildo.value = 'medium';" />
<input name="submit" type="image" src="3_small.jpg" alt="Stor dildo" align="right" onClick="javascript:document.forms[0].dildo.value = 'big';" />
<input name="dildo" type="hidden" value="" /><br />
</form>
Posts: 8
Threads: 3
Joined: Sep 2013
Reputation:
0
Hi Ben,
How would a multiple submit button situation work when using an external form rather than the API?
Both buttons want to submit the data the same way but lead to different destinations. First button, a thank you page; second button, an additional form with another set of fields.
The formtools admin interface seems to only support one button in this regard.
Thanks for any help.
Regards,
Mark Harrison