You'll need an onchange event on the text box to fire the js function. Or maybe an onblur, to check the radio button when you leave the field.
onchange="setDateRangeCheck()" On 10/19/07, Scott Stewart <[EMAIL PROTECTED]> wrote: > > As soon as I start entering characters in the text box, the radio button > should check. It doesn't.... no love for Scott :( > > Firebug returns no errors... > > -- > Scott Stewart > ColdFusion Developer > > SSTWebworks > 4405 Oakshyre Way > Raleigh, NC. 27616 > (703) 220-2835 > > http://www.sstwebworks.com > http://www.linkedin.com/in/sstwebworks > > Boycott Sys-Con > > > -----Original Message----- > From: Charlie Griefer [mailto:[EMAIL PROTECTED] > Sent: Friday, October 19, 2007 5:17 PM > To: CF-Community > Subject: Re: Javascript question > > define "doesn't work"? :) > > are you testing this in firefox using the firebug extension (if you're > not, you should be). > > so says the javascript goddess (hey i'll take whatever title i can get) :) > > On 10/19/07, Scott Stewart <[EMAIL PROTECTED]> wrote: > > While it doesn't throw an error, it doesn't work either > > > > Here's the html to go with it > > > > <li> > > <input type="radio" name="pub" value="F" id="advsPubF" > > #sfm.htmlChecked(sfd.pub is "F")# /> > > <label for="advsPubF">From</label> > > <input id="advsPubF1" name="pubf1" type="text" size="4" > > value="#sfd.pubf1#" /> to <input name="pubf2" id="advsPubF2" type="text" > > size="4" value="#sfd.pubf2#" /> > > </li> > > > > -- > > Scott Stewart > > ColdFusion Developer > > > > SSTWebworks > > 4405 Oakshyre Way > > Raleigh, NC. 27616 > > (703) 220-2835 > > > > http://www.sstwebworks.com > > http://www.linkedin.com/in/sstwebworks > > > > Boycott Sys-Con > > > > -----Original Message----- > > From: Charlie Griefer [mailto:[EMAIL PROTECTED] > > Sent: Friday, October 19, 2007 2:12 PM > > To: CF-Community > > Subject: Re: Javascript question > > > > your syntax is off > > > > document.getElementById('advsPubF1').value.length > 1 > > document.getElementById('advsPubF').checked = true; > > > > On 10/19/07, Scott Stewart <[EMAIL PROTECTED]> wrote: > > > Hey all, > > > > > > > > > > > > I've got another weird one. > > > > > > > > > > > > How would you check a radio button, based on whether or not text is > > entered > > > in an adjacent text box? > > > > > > > > > > > > Here what I did: > > > > > > > > > > > > function setDateRangeCheck(){ > > > > > > if (document.getElementById.advsPubF1.length > 1){ > > > > > > document.getElementById.advsPubF.checked = true; > > > > > > } > > > > > > } > > > > > > > > > > > > This is called in a body: onLoad > > > > > > > > > > > > The error states that neither advsPubF1 or advsPubF have properties.. > > > > > > > > > > > > Halp!!!! > > > > > > > > > > > > sas > > > > > > > > > > > > -- > > > > > > Scott Stewart > > > > > > ColdFusion Developer > > > > > > > > > > > > SSTWebworks > > > > > > 4405 Oakshyre Way > > > > > > Raleigh, NC. 27616 > > > > > > (703) 220-2835 > > > > > > > > > > > > http://www.sstwebworks.com > > > > > > <http://www.linkedin.com/in/sstwebworks> > > > http://www.linkedin.com/in/sstwebworks > > > > > > > > > > > > Boycott > > > < > http://www.sstwebworks.com/blog/index.cfm/2007/10/16/Boycotting-SysCon> > > > Sys-Con > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Get involved in the latest ColdFusion discussions, product development sharing, and articles on the Adobe Labs wiki. http://labs/adobe.com/wiki/index.php/ColdFusion_8 Archive: http://www.houseoffusion.com/groups/CF-Community/message.cfm/messageid:244716 Subscription: http://www.houseoffusion.com/groups/CF-Community/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.5
