> -----Original Message----- > From: Chris Shiflett [mailto:[EMAIL PROTECTED] > Sent: woensdag 12 november 2003 17:23 > To: Alan Lord; [EMAIL PROTECTED] > Subject: Re: [PHP] <form action="?"> > > --- Alan Lord <[EMAIL PROTECTED]> wrote: > > can I put a function_name() in the <form action="..."> place holder?
For once and for all .. NO, you cannot do that. The form is submitted to a page, and this page will execute funtions. What you might want to do is this (though I doubt if you want to do it cuz it is pretty unsafe): <forma action='execute.php?f=function_name' method='post'> == execute.php ====== <?php if (isset($_POST['f'])) $_POST['f'](); ?> > > I think you can do this with JavaScript, yes. No, Chris. For as far as I know you cannot even do this with JavaScript. Though I've never tried it. What you can do is use the 'onSubmit' event like this: <form action='foo.php' onSubmit='return FunctionDeclaredInJavascript()'> Where FunctionDeclaredInJavascript() is a function declared in JS (not in PHP). If it returns false the form will not be submitted, if it returns true the form will .. Guesss what? :P > > Chris > > ===== > My Blog > http://shiflett.org/ > HTTP Developer's Handbook > http://httphandbook.org/ > RAMP Training Courses > http://www.nyphp.org/ramp > > -- > PHP General Mailing List (http://www.php.net/) To > unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php