-
1. Re: Hiding Required Information Based on Form Input Information
Dan Bracuk Dec 27, 2010 5:22 AM (in response to OgreOne)You have to use javascript, not coldfusion code to accomplish this. One approach you might try is to create a couple of variables. One will be an empty string and the other will be the required form fields. Then you use those variables for the value of a div or span, based on the radio button selection.
I've done this type of thing poorly a few times, but I remember that BKBK once posted something on these forums that seemed like a really good way to go about it.
-
2. Re: Hiding Required Information Based on Form Input Information
Dan Bracuk Dec 27, 2010 6:18 AM (in response to Dan Bracuk)Actually, one of my methods wasn't all that bad. It just works differently in firefox than in IE. Don't know about other OS/browsers.
Use cfsavecontent to create a coldfusion variable with your required form fields.
Use toScript() to send that variable to javascript.
Use innerHTML to change the value of your div.
-
3. Re: Hiding Required Information Based on Form Input Information
OgreOne Dec 27, 2010 5:44 PM (in response to Dan Bracuk)Thanks for the comments. Guess it is hopless then. I really dislike JavaScript and try not to program with it unless a client really "needs" it. Too bad Coldfusion can't build in a way to do this kind of conditional on the fly.
Thanks anyway.
-
4. Re: Hiding Required Information Based on Form Input Information
Adam Cameron. Dec 28, 2010 1:17 AM (in response to OgreOne)I really dislike JavaScript and try not to program with it unless a client really "needs" it.
Hang on. You said you're using JQuery and <cfform>. Both of which use JavaScript "heavily". All JQuery is is a JS library: it's pure JavaScript!
Too bad Coldfusion can't build in a way to do this kind of conditional on the fly.
If you need to do something client-side then you need to use a client-side technology... JS or Flash, basically.
CF runs on the CF server and has (and can have ~) no interaction with the client browser.
I think you need to sit back and do some reading and understand how all the technology components fit together in the HTTP request/response lifecycle, because you seem to be labouring under some misconceptions, based on the wording of your post.
--
Adam
-
5. Re: Hiding Required Information Based on Form Input Information
OgreOne Dec 28, 2010 5:00 AM (in response to Adam Cameron.)No, I understand that both rely heavily on JS. I am not that naive. I just would thing that maybe the programmers would come up with an extension or something to help automate the process a little more. I just don't see how me being the only one, or few who would use this. When it comes to jQuery/JavaScript, a lot of us work with libraries or already coded examples that we tweak (especially those who are more design-oriented, less programming). Maybe Adobe/Macromedia has done a disservice in helping us out too much.
Anyway, no you are right, JavaScript is required. I just don't want to program THAT much for one or two fields so I think I will try and go the Custom Error Page method and see what I can do there.
Thanks all. I love Adobe forums because you always get an answer.
-
6. Re: Hiding Required Information Based on Form Input Information
Dan Bracuk Dec 28, 2010 5:44 AM (in response to OgreOne)Regarding, "When it comes to jQuery/JavaScript, a lot of us work with libraries or already coded examples that we tweak (especially those who are more design-oriented, less programming)."
I'm a programmer and I do that too. Fortunately there are lot's of coded examples on the internet and good search engines with which to find them.

