Skip to main content
Inspiring
November 10, 2008
Question

Make a form not active..... ??

  • November 10, 2008
  • 3 replies
  • 373 views
Is there a way to make a <cfform> not active unless certain conditions are
met? Like say, someone is logged in???


    This topic has been closed for replies.

    3 replies

    Inspiring
    November 11, 2008
    yes, i would also not display the form at all unless the condition is
    met - why even display a form to a user if he can't use it??? display a
    note instead saying something like "please log in to [do whatever the
    form does]".

    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/
    November 10, 2008
    If possible, I would remove the form entirely until the condition is met - this way it would be more accessible and less annoying.

    If you're going to disable the form, at least disable ALL of the fields, because the last thing I'd want to see when filling in a form, is the fact that I can't submit it. I would have spent so much time filling it out only to get annoyed....and since this would be done with CFML, it would probably indeed require a page refresh opf some kind to get them enabled again...unless you used AJAX or something I suppose...but then if you were gonna do that, you may aswell use JS entirely.

    Just my thoughts!

    Mikey.
    Inspiring
    November 10, 2008
    put it inside a <cfif> block maybe? or do you still want to display it,
    just make it non-functional? you could also make all form elements
    disabled... actually just making the submit button disabled will be enough.

    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/
    Inspiring
    November 10, 2008
    Hello Azadi,

    Yes, I still wanted to display the form fields.....

    I could make all the form elements disabled, but that seems a bit odd ;)

    I was hoping I could 'grey out' the form until it was active...... I could
    disable the submit button as well, not a bad idea..... with a combination
    of disabling the form fields, that way someone doesn't enter information
    to then find out they can't submit the form.......



    > put it inside a <cfif> block maybe? or do you still want to display
    > it, just make it non-functional? you could also make all form elements
    > disabled... actually just making the submit button disabled will be
    > enough.
    >
    > Azadi Saryev
    > Sabai-dee.com
    > http://www.sabai-dee.com/