Why would you need to?

The form name is only present as an identifier for client-side script, it
really has nothing to do with server-side processing since only one form is
ever being processed by any request.  One the client-side there can be
multiple forms on the same page (thus the need to distinguish them) but on
the server this isn't the case.

However you CAN post information to the server via fields - the simple
solution is to pass a hidden field with the name of the form.  Something
like:

<form name="FormA">

<input type="hidden" name="FormName" value="FormA">

</form>

<form name="FormB">

<input type="hidden" name="FormName" value="FormB">

</form>

You can then look at FORM.FormName in ColdFusion to see which form was
posted.

You could also check the value of the submit button if the forms have
different button values.  Something like:

<form name="FormA">

<input type="submit" name="Submit" value="Update Record A">

</form>

<form name="FormB">

<input type="submit" name="Submit" value=" Update Record B">

</form>

Hope this helps,

Jim Davis



  _____  

From: Andrew Grosset [mailto:[EMAIL PROTECTED]
Sent: Saturday, April 10, 2004 2:29 AM
To: CF-Talk
Subject: evaluating name of form

If I have a form named "login_form" how do I determine the name of the form
on the processing (post) page?

  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to