• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Cold Fusion Question with: CF SWITCH

LEGEND ,
Nov 22, 2006 Nov 22, 2006

Copy link to clipboard

Copied

I am using CFSWITCH for a long form. Its all working great, but I want to
add some validation so I set up certain statements to make sure a form field
from the previous step hasn't been overlooked. If it has then the error
message shows rather than the next steps and asks you to return to the
previous step. All works great.

However, when you go back to the previous step I would like the header for
the field that needs to be corrected to show in red (the error message
style).

I have tried setting a variable to true with the error message but when you
hit the back button you loose the variable setting. I tried a session, but
again, you loose it. Does anyone have any ideas that I can try so that I can
get the headers to be in red for the user?

Kim


TOPICS
Advanced techniques

Views

353

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 22, 2006 Nov 22, 2006

Copy link to clipboard

Copied

Instead of sending them back to the previous step, send them forward to the previous step with some sort of http request. Then you get to set more variables and display your message.

You should also investigate any ways that might be available for increasing the amount of validation done on the client when the form is submitted.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 22, 2006 Nov 22, 2006

Copy link to clipboard

Copied

Dan,

That would be something new to me. Can you point me to either a tutorial or
something that would help explain this to me so I can research it.

Thanks,
Kim

"Dan Bracuk" <webforumsuser@macromedia.com> wrote in message
news:ek289v$fvq$1@forums.macromedia.com...
> Instead of sending them back to the previous step, send them forward to
> the
> previous step with some sort of http request. Then you get to set more
> variables and display your message.
>
> You should also investigate any ways that might be available for
> increasing
> the amount of validation done on the client when the form is submitted.
>


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Nov 22, 2006 Nov 22, 2006

Copy link to clipboard

Copied

One way to do this is to have the form page submit to itself. If everything validates and all required fields are completed, the program can update a database (or whatever) and then either go on to another page (via CFLOCATION) or just display a message saying the form was submitted.

Otherwise, the program can redisplay the form with an error message at the beginning. The values that were already submitted can be inserted in the various fields, and missing values could be checked so that they are highlighted with red text or a different color background.

This is better from a usability perspective since the user receives the error message and can complete the form on the same page, instead of having to navigate back or to another page.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 22, 2006 Nov 22, 2006

Copy link to clipboard

Copied

LATEST
quote:

Originally posted by: Newsgroup User
Dan,

That would be something new to me. Can you point me to either a tutorial or
something that would help explain this to me so I can research it.


An anchor tag will work. So will a form with a bunch of hidden fields and a submit button.

If you want the user to be taken ahead back to the form page without having to do anything, the cflocation tag is available. So is meta refresh, javascript window.location, and so on and so forth.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation