On the page act_AddNewEmployee.cfm I would cfinclude a file called
act_FormProcessing.cfm and set some kind of counter at the top of the page.
Do the form validation and everytime an error is identified increment the
counter and display the error message. At the bottom of act_FormProcessing
see if the error count has incremented and if it has cfabort the page while
still inside of act_FormProcessing and supply the user with a javascript
back button ... from what I've seen the form values the user initially typed
in are still in the form ready to be changed because the page was cached.
If there are no errors then there will be nothing generated by
act_FormProcessing and act_AddNewEmployee will do what it needs to do.

The cool thing about doing it this way is if you have an add form and then
an update form you can cfinclude the same act_FormProcessing file for both
because the rules don't change!

As a side note, I have also found the below piece of code has eleminated the
possibility of impatient form submitters hitting the submit button multiple
times and creating multiple form submisions ... it completely disables the
submit button after it is pressed once and displays a message notifying the
user that the form is being processed.

<SCRIPT LANGUAGE="JavaScript">
<!--
function resetButtons() {
SearchText.style.visibility = 'hidden';
AddObject.SearchButton.disabled = '';
}
function disableButtons() {
AddObject.SearchButton.disabled = 'true';
SearchText.style.visibility = 'visible';
setTimeout('resetButtons()',150000);
}
//-->
</SCRIPT>
<br>
<div align="center"><INPUT TYPE=BUTTON NAME=SearchButton
onclick="submit();disableButtons();" VALUE="Add This Information"></div>
<DIV ID=SearchText
Style="position:'relative';left:0;top:5;visibility:'hidden'">Now Searching
... <br>Please be patient something is happening!</DIV><br>



-----Original Message-----
From: Joshua White [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 23, 2000 9:19 AM
To: '[EMAIL PROTECTED]'
Subject: Form Validation?


Hey all,

I have an employee form that has three modes (Add, Edit, Error).  The form
"posts" to a "validateIt" fuseAction that validates form data on the server
side.
If I am adding a new employee, and the form variables pass the checks, I am
not sure if I should include the file act_AddNewEmployee.cfm or cflocation
to a seperate fuseAction.  Including these files makes sense because if the
data does not pass the tests, I can include the form into the validateIt
file and easily repopulate the fields with the offending data.  Do any of
you see a problem with this or have any other recommendations?

Joshua



++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
CONFIDENTIALITY NOTICE: If you have received this e-mail in error,
please immediately notify the Sender by e-mail at the address
shown and delete all copies of this message.  This e-mail transmission
may contain information that is proprietary, privileged,
confidential, or otherwise legally exempt from disclosure.  If you
are not the named addressee, please be aware that you are not
authorized to open, read, print, retain, copy, or disseminate
this message or any part of it.  Thank you for your compliance.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
----------------------------------------------------------------------------
--
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/fusebox or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

------------------------------------------------------------------------------
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/fusebox or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to