[PHP] Re: determine action of a form dynamically?

2003-06-04 Thread Monty
 Hi,
 I want action of a form to be PHP_SELF untill user presses continue
 button. If continue button is pressed than next.php should be the action of
 the form. how to do this? Thanks in advance, Mukta

I'm not sure why it's necessary to do this, but, not sure it can be done.
Maybe with Javascript and an onClick= command inside the input button tag
or an onSubmit= inside the form tag.

Do you simply want to hide the name of the file that the form will go to
once a button is clicked? If so, you need an in-between script that the
form uses to determine where to send the user. So instead of sending them to
PHP_SELF or next.php, use something like goto.php, which can determine where
to send the user next, and then redirects the user using the header()
function.

Monty


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: determine action of a form dynamically?

2003-06-04 Thread Yves Daemen
Best way to do this, in my opinion, is by using a javascript-code like this

input type=button onClick=processForm('next.php');
input type=button onClick=processForm('?php echo $PHP_SELF; ?');

The javascript function would then look like this:

function processForm(url) {
  document.forms[0].action = url;
  document.forms[0].submit();
}


Mukta Telang [EMAIL PROTECTED] schreef in bericht
news:[EMAIL PROTECTED]
 Hi,
 I want action of a form to be PHP_SELF untill user presses continue
 button.
 If continue button is pressed than next.php should be the action of
 the form.
 how to do this?
 Thanks in advance,
 Mukta



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php