Thanks Baconfries,
If you look up at the top, I have already found this
Ayyway, thanks again
One form - 3 buttons
Forum rules
PLEASE READ THE FORUM RULES BEFORE YOU POST:
viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/forms.html
http://www.wysiwygwebbuilder.com/form_wizard.html
Frequently Asked Questions about Forms
PLEASE READ THE FORUM RULES BEFORE YOU POST:
viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/forms.html
http://www.wysiwygwebbuilder.com/form_wizard.html
Frequently Asked Questions about Forms
- BaconFries
-
- Posts: 5364
- Joined: Thu Aug 16, 2007 7:32 pm
Re: One form - 3 buttons
Yes I know, my suggestion was if you require help on how to use then contact the original author of the script at the page....
https://www.rgagnon.com/jsdetails/js-0018.html
https://www.rgagnon.com/jsdetails/js-0018.html
Re: One form - 3 buttons
Thanks, I didn't try it yet - I have more problems with my other topic
How to make a Dialog to be Modal....
I tried everything, maybe you can help me with it here
https://www.wysiwygwebbuilder.com/forum ... 07#p424107
Cheers
How to make a Dialog to be Modal....
I tried everything, maybe you can help me with it here
https://www.wysiwygwebbuilder.com/forum ... 07#p424107
Cheers
Re: One form - 3 buttons
Yes! By using the script you suggested yourself.So, I am not clear - Can any of the 3 buttons become the submit and just call another page?
Step 1
add 2 extra pages, so you have a total of forms with different email addresses. Those pages will be the destination pages for form action you are going to control via the script.
Step 2
Modify the 'submitFunction' script so the click of each button will modify the action of the form (and submit it)
Re: One form - 3 buttons
I implemented the following code (ignoring the submit of the email for now)
<script type="text/javascript">
function submitFunction(i)
{
if (i==1)
{
// This next call, loads the page into the whole browser screen, NOT a popup dialog
window.location = "https://communitylifestyleaccommodation ... rship.html"
// This call, loads it as a dialog popup - BUT it is NOT Modal - can't find in WWB properties where to set that to be a Modal page
var myWindow = window.open("https://communitylifestyleaccommodation ... rship.html", "", "width=800,height=650");
}
if (i==2)
{
window.location = "";
}
if (i==3)
{
window.location = "";
}
//document.theForm.submit();
}
</script>
<script type="text/javascript">
function submitFunction(i)
{
if (i==1)
{
// This next call, loads the page into the whole browser screen, NOT a popup dialog
window.location = "https://communitylifestyleaccommodation ... rship.html"
// This call, loads it as a dialog popup - BUT it is NOT Modal - can't find in WWB properties where to set that to be a Modal page
var myWindow = window.open("https://communitylifestyleaccommodation ... rship.html", "", "width=800,height=650");
}
if (i==2)
{
window.location = "";
}
if (i==3)
{
window.location = "";
}
//document.theForm.submit();
}
</script>
Re: One form - 3 buttons
Sorry, but this is not correct.
You will need to change the action property of the form, like in the original script.
This is what you wrote:
It looked like you understood me after my first reply and now you are going into a complete different direction!
Please stick the original idea.
You will need to change the action property of the form, like in the original script.
This is what you wrote:
Code: Select all
<SCRIPT>
function submitFunction(i) {
if (i==1) document.theForm.action=
"http://www.company.com/cgi-bin/cgi1.cgi";
if (i==2) document.theForm.action=
"http://www.company.com/cgi-bin/cgi2.cgi";
if (i==3) document.theForm.action=
"http://www.company.com/cgi-bin/cgi3.cgi";
document.theForm.submit()
}
</SCRIPT>
<FORM NAME="theForm">
<INPUT TYPE="button" VALUE="Submit 1" onClick="submitFunction(1)">
<INPUT TYPE="button" VALUE="Submit 2" onClick="submitFunction(2)">
<INPUT TYPE="button" VALUE="Submit 3" onClick="submitFunction(3)">
</FORM>
Please stick the original idea.
Re: One form - 3 buttons
OK, When I cahneg it back to the original, my code looks like the below segment - But, when I click the button "Membership" nothing happens. I placed an alert() inside the if(i==1) and it shows up when I click the button
<script type="text/javascript">
function submitFunction(i)
{
if (i==1)
{
document.theForm.action="https://communitylifestyleaccommodation ... rship.html";
}
if (i==2)
{
document.theForm.action= "";
}
if (i==3)
{
document.theForm.action= "";
}
document.theForm.submit();
}
</script>
<script type="text/javascript">
function submitFunction(i)
{
if (i==1)
{
document.theForm.action="https://communitylifestyleaccommodation ... rship.html";
}
if (i==2)
{
document.theForm.action= "";
}
if (i==3)
{
document.theForm.action= "";
}
document.theForm.submit();
}
</script>
Re: One form - 3 buttons
There is an error in the script:
should be:
Also the form pages should be PHP.
Code: Select all
alert(Hello dialog);
Code: Select all
alert('Hello dialog');
Re: One form - 3 buttons
Here is a sample of what's required (I think!).
I thought you might prefer 3 payment pages, if not just delete 2 and 3 and adjust the success page entries.
http://www.mediafire.com/file/abqb3odk1 ... m.wbs/file
EDIT:
I tested it on a local server so you might need to change the URLs in submitFunction function.
I thought you might prefer 3 payment pages, if not just delete 2 and 3 and adjust the success page entries.
http://www.mediafire.com/file/abqb3odk1 ... m.wbs/file
EDIT:
I tested it on a local server so you might need to change the URLs in submitFunction function.
Re: One form - 3 buttons
Hello WWBman
In the meantime, I got more details from the Payment Gateway people
At the end of processing the money transaction. the Gateway sends an email with all the details to a nomiated email address, so in fact I do NOT need to process any form at my end.
Therefore the Welcome page with the 3 buttons doesn't need any special thing, each of the 3 buttons is calling a different WWB Object with a specific description of Membership, Donations, Raffle tickets.
My only remaining problem at the momemnt is that as it stands now, when the transaction is done, the visitor is left on a blank screen... This is of course wrong and I am looking for a way to get back to the front screen of the website
Thanks
In the meantime, I got more details from the Payment Gateway people
At the end of processing the money transaction. the Gateway sends an email with all the details to a nomiated email address, so in fact I do NOT need to process any form at my end.
Therefore the Welcome page with the 3 buttons doesn't need any special thing, each of the 3 buttons is calling a different WWB Object with a specific description of Membership, Donations, Raffle tickets.
My only remaining problem at the momemnt is that as it stands now, when the transaction is done, the visitor is left on a blank screen... This is of course wrong and I am looking for a way to get back to the front screen of the website
Thanks