disabled form elements undefined

Last post 06-04-2008, 1:53 PM by gary.storey. 4 replies.
Sort Posts: Previous Next
  •  04-21-2008, 11:22 AM 11166

    disabled form elements undefined

    I have a scenario where based on criteria A I default a form element and then if it meets criteria B I disable the element to restrict the user from changing the value. But when it is disabled the default value does not pass to case2.asp. Rather Request.Form("x_my_var").Item returns 'undefined'. Any way to get the value of the disabled form field?

  •  04-21-2008, 1:29 PM 11167 in reply to 11166

    Re: disabled form elements undefined

    Best I can come up with here is after Validate() and before frmCase.Submit() to enable all my custom elements that have a disabled option.
  •  04-21-2008, 3:12 PM 11169 in reply to 11167

    Re: disabled form elements undefined

    Disabled form elements do not get posted. This is standard web behavior, not specific to Dovetail.

    You can make the element readonly. Or hidden.

     


    ---
    Gary Sherman
    gary@dovetailsoftware.com
  •  04-21-2008, 3:34 PM 11170 in reply to 11169

    Re: disabled form elements undefined

    I know it is standard web behavior, I was just hoping one of the html gurus on this forum may know a good way around it since Dovetail uses so many disabled attributes int he code! Big Smile For the time being I am just doing a document.getElementById('x_my_var).disabled = false; before I submit the form so they post. It seems to work OK thus far. I can't hide them since they must be visible and most of them are <select> elements using GetHgbstList() so I can't make them RO since I believe RO only works for input and textarea.

    Thanks Gary!

  •  06-04-2008, 1:53 PM 11275 in reply to 11170

    Re: disabled form elements undefined

    Better late than never I guess... Smile

    I posted a few javascript routines on the site the other day.  There are a couple that specfically deal with enabling/disabling form fields.

    http://blogs.dovetailsoftware.com/forums/thread/11260.aspx

     


    Gary Storey
View as RSS news feed in XML