Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How Ask Uer for Confimraiton of Responses On Data Entry Form

Status
Not open for further replies.

mmignot

Programmer
Jul 16, 2001
44
US
Hello

I have a form with 35 questions on it. All of the questions are optional, but if the user skipped some questions I'd like to be able to display a message (possibly on a pop-up screen or message box) that lets the user know which questions were skipped and to confirm that the skipped questions were intentional. I'm new to coldfusion/javascript and am not sure how to accomplish this. Any help would be greatly appreciated!!!

Many thanks,
Mark M.
 
Hi

Well, given the insignificant amount of details :
[ul]
[li]set a string to empty[/li]
[li]iterate over the controls[ul]
[li]if a control is empty[ul]
[li]append its description to the string[/li]
[/ul][/li][/ul][/li]
[li]if the string is not empty[ul]
[li]display the string in a [tt]confirm()[/tt][/li]
[li]if the visitor not confirms[ul]
[li]stop the submit[/li]
[/ul][/li][/ul][/li]
[/ul]
If this is not enough, give us some details about your [tt]form[/tt] and the controls. The best would be to post an URL to a publicly available version of the page.

Feherke.
 
While this is certainly possible with JavaScript, I'd ask in the ColdFusion forum as a first port of call for several reasons:

- With server-side validation, those with JS disabled will still see error messages,

- You may well find that there's a really easy way to perform validation and have the error messages, etc, handled for you, much like the form binding you can get with Java / Grails / etc.

If it turns out there is no mechanism for auto-wiring form elements & errors in CFM, then I'd still recommend coding a server-side solution (either as well as, or instead of, a JS one).

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top