Hi,
I've been searching the forums on this issue but I can't locate a precise answer so hence the new post.
I understand how to get a form to submit and move to another form. The quesiont is:
how do you get a second button on the same form to perform a different action?
e.g. submit = submit. exit button goes to a different form or it may close the window?
any ideas?
aj
I've been searching the forums on this issue but I can't locate a precise answer so hence the new post.
I understand how to get a form to submit and move to another form. The quesiont is:
how do you get a second button on the same form to perform a different action?
e.g. submit = submit. exit button goes to a different form or it may close the window?
any ideas?
aj
Untested, but should work from memory:
And "on Submit (after email)":
/Fredrik
... Your name: <input type="text" name="fullname" /><br />
<input type="submit" name="sbutton" value="Submit data" /> or <input type="submit" name="sbutton" value="Exit" />
And "on Submit (after email)":
<?
$action = JRequest::getString('sbutton');
if (strcasecmp($action, 'submit data') != 0) {
//Redirect to some other url...
$t =& JFactory::getApplication('site');
$t->initialise();
$t->redirect('http://www.somehost.com/somewhere.html');
}
/Fredrik
Hi aj,
From memory there may be some problems in IE with submit buttons that don't have name='submit' - if you find problems try changing this.
Bob
From memory there may be some problems in IE with submit buttons that don't have name='submit' - if you find problems try changing this.
Bob
Thanks Bob,
I'll look out for that. Almost none of my buttons use "submit" as name.
aj
I'll look out for that. Almost none of my buttons use "submit" as name.
aj
Hi Bob,
Just a bit of feedback on your previous heads-up re: IE.
It (the form solution) seems to work OK on IE8. (yes, brave really, but you have to test on as much as possible ):) IE7 has all sorts of issues but I think I need to revisit my newbie PHP code before I assign blame to MS (as much as I'd like to ) :wink:
aj
Just a bit of feedback on your previous heads-up re: IE.
It (the form solution) seems to work OK on IE8. (yes, brave really, but you have to test on as much as possible ):) IE7 has all sorts of issues but I think I need to revisit my newbie PHP code before I assign blame to MS (as much as I'd like to ) :wink:
aj
Hi ajw3208,
Sounds good. Just in case it's helpful - I have recently discovered IETester which is a very neat browser-like application that loads multiple IE emulators at the same time IE5,5, 6, 7, & 8. It even makes debugging a little easier.
Bob
Sounds good. Just in case it's helpful - I have recently discovered IETester which is a very neat browser-like application that loads multiple IE emulators at the same time IE5,5, 6, 7, & 8. It even makes debugging a little easier.
Bob
Hi Bob,
The code below works really well if you need to redirect.
what does it look like if you need an alternate form action URL? What is the best way to modify the code below to create an alternate form action. Use case is
press submit btn #1 on form4 and on submit form action = ......regoform5
press submit btn#2 on form 4 and on submit form action = .......regoholder (the loop action). This is the one that needs to maintain the $_POST array
regards,
aj
p.s. Yes, this is same question is in the chaining post as the two issues stem from the same form🙂
The code below works really well if you need to redirect.
what does it look like if you need an alternate form action URL? What is the best way to modify the code below to create an alternate form action. Use case is
press submit btn #1 on form4 and on submit form action = ......regoform5
press submit btn#2 on form 4 and on submit form action = .......regoholder (the loop action). This is the one that needs to maintain the $_POST array
regards,
aj
p.s. Yes, this is same question is in the chaining post as the two issues stem from the same form🙂
<?php
$action = JRequest::getString('rf4sBtn');
if (strcasecmp($action, 'Next') == 0) {
//Redirect to some other url...
$t =& JFactory::getApplication('site');
$t->initialise();
$t->redirect('index.php?option=com_chronocontact&chronoformname=regoform1');
}
?>
Hi aj,
The multipage plugin uses this syntax
Bob
The multipage plugin uses this syntax
$nextForm->showForm('form_name', $posted);
I think that $MyForm would probably work as well. Bob
Hi Bob,
Oops, it went Bang!.
this is the error.
Fatal error: Call to a member function showForm() on a non-object in /home/wphcfc/public_html/z-wphctesting/components/com_chronocontact/libraries/customcode.php(42) : eval()'d code on line 8
This is the code in On Submit code - after sending email:
There is no URl in on submit in form URL tab of the form.
Pretty sure I'm doing something wrong but not sure what
aj
Oops, it went Bang!.
this is the error.
Fatal error: Call to a member function showForm() on a non-object in /home/wphcfc/public_html/z-wphctesting/components/com_chronocontact/libraries/customcode.php(42) : eval()'d code on line 8
This is the code in On Submit code - after sending email:
There is no URl in on submit in form URL tab of the form.
Pretty sure I'm doing something wrong but not sure what
aj
<?php
$action = JRequest::getString('rf4sBtn');
if (strcasecmp($action, 'Next') != 0) {
//Redirect to some other url...
//$t =& JFactory::getApplication('site');
//$t->initialise();
//$t->redirect('index.php?option=com_chronocontact&chronoformname=regoholder');
$t->showForm('regoholder', $posted);
}
?>
Hi aj,
$t isn't defined so the bang is correct . . . please try it with $MyForm->
Bob
$t isn't defined so the bang is correct . . . please try it with $MyForm->
Bob
This topic is locked and no more replies can be posted.