Rick Dennis wrote:
> 
> i have a customer input page that has this code at the bottom of the page 
> right before the submit button. 
> 
> well on the same page i have a checkbox that if checked, it needs to
> ignore 
> this same piece of code.
> if the check box is checked, i want it to do this  
> 
> how do i do this since the check box is on the same page as the piece of 
> code having the required field?
> 
> Rick Dennis
> 

The basic problem is that the "status_required" field is there to make use
of CF's "magic"form validation
(see http://tinyurl.com/atn87) - so you won't be able to handle this after
the page is submitted, since cf's magic code will run before anything you
can do (not sure about code in the OnRequestStart method of the
Application.cfc)

I'd say:
1) remove the field completely and implement your own server side validation
("status" is required unless [checkbox]). This assumes that you're already
doing some kind of server side validation, so that you can slot this in
without too much trouble.

2) Redirect from javascript:

Of course, the users lose all the information they entered into the form...

3) use javascript to disable/enable the hidden field (this is a wild guess,
haven't tested but should work). If the field is disabled, the value is not
sent to the back end, and so the magic validation rule requiring the
presence of the "status"field never fires... Plus you still have access to
all the other stuff they filled in.

/t


-- 
View this message in context: 
http://www.nabble.com/%3Cinput-type%3D%22Hidden%22-name%3D%22status_required%22%3E-issue-tf2417019.html#a6742144
Sent from the Cold Fusion - Technical mailing list archive at Nabble.com.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:256152
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to