Form Manager
Disable Field (3 posts)

  1. aschott
    Posted 2 years ago #

    I'm looking for a way to disable a text input field. I have datepicker instantiated on this field when javascript is in use, but if a visitor is not allowing javascript I need to have the field disabled to force them to call the office instead of letting them type in any date they wish.

    Any ideas are appreciated.


  2. Samatva
    Posted 2 years ago #

    PHP scripts have a hard time telling if JavaScript is disabled. The way to do it is to insert a disabled field and enable it with JavaScript (embedded in a 'Note' field).

    You could set a 'Note' field with HTML enabled containing <noscript>Please call the office...</noscript>

    Sometimes, you just have to hope the person can follow instructions!

  3. aschott
    Posted 2 years ago #

    That's a great idea; I never considered embedding fields or JS in a note field. After talking more with the folks upstairs though I might just have to disable the whole form if they don't have JS; use JS to display:block or something I guess.

    Thanks for the reply Samatva, if nothing else that's a great possibility to keep in mind. Heh, if only they could follow instructions - wouldn't be posting in the first place! :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic