Because Disabled is part of the standard for the
<input...> tag that a
<cfinput...> tag is turned into by the ColdFusion
engine in the response
that is sent to the client.
By the time your javascript running on the client is trying
to access
it, it is long gone and done with. This is the standard
separation of
what happens on the server and what happens on the client and
they don't
mix together.
What that required attribute is doing is creating some
automagic
javascript functions. If you look at your source you should
be able to
see what was created and figure out what you may be able to
change. I
would guess some kind of on_blur or on_submit event.
Natesac wrote:
> Hey kids... Here's what I'm trying to do...
>
> I have a form that has two required fields, and then a
checkbox after those
> which, if checked, disables the first two fields.
However, when I try to
> submit my form, I still get the Alert message based on
the requirements of the
> fields. Now, I tried doing this, which I thought may
work in the same fashion
> as changing the disabled value:
>
> <cfquery name="sourcekeys" datasource="momlink">
> Select Adkey, Addate, AdProd
> From Adcosts
> </cfquery>
>
> <cfselect name="AdPrefix" display="AdPrefix"
query="getPrefixes"
> value="AdPrefix" class="style14" style="width:75px;"
required="yes"
> message="Please select a Source Key
Prefix"></cfselect>
>
> <cfinput type="text" class="style14" name="AdSuffix"
value="" required="yes"
> maxlength="4" style="width:20px;" message="Please enter
the 3 or 4 digit
> sequence that correponds to the Source Key"
validate="integer">
>
> or Outbound
>
> <input type="checkbox" class="style14"
name="Outbound" value="Outbound"
>
onClick="if(document.checkoutform.Outbound.checked==true){document.checkoutform.
>
AdPrefix.disabled=true;document.checkoutform.AdSuffix.disabled=true;document.che
> ckoutform.AdPrefix.required='no';
>
>
document.checkoutform.AdSuffix.required='no';};if(document.checkoutform.Outbound
>
.checked==false){document.checkoutform.AdPrefix.disabled=false;document.checkout
> form.AdSuffix.disabled=false;};"
> <cfif MomCustnumCheck eq
False>disabled</cfif>>
>
> Any thoughts as to why I'm able to change the value of
DISABLED in my
> cfinputs, and not the REQUIRED attribute?
>
> Many thanks, oh gurus of the fusion.
>
> -Nathan
>