Hi all, 

I have an issue .... 
Have a form and have the three raio buttons and I grouped it. Need to select 
one option and depending on the option need to fill texboxes. I am able to 
select the radio button and produce the error message. 
I am trying to disable and enable textboxes and validate them depends on radio 
button selection. I am able to disable and enable texboxes but unable to 
validate boxes. 

If I select Option1 ---- It will disable text boxes
If I select option2 or option3  --- enable extboxes and validate boxes
textbox1 --- should validate the length=12, should be numeric, should not be 
empty
textbox2 --- should validate the length=10, should be numeric, should not be 
empty

Thanks,


Can anyone hel with this???? 

<cfform name='form1'>
<cfinput type="radio" name="rb_deposit" value="" id ="id_check" onclick 
="funcone()" required="yes" message="Please select 
option"><span>Option1</span><br/>
<cfinput type="radio" name="rb_deposit" value="" id ="id_check1" 
onclick="check1()"><span>Option2</span><br/>
<cfinput type="radio" name="rb_deposit" value="" id ="id_check2" 
onclick="check1()"><span>Option3</span><br/>
<input type="text" name="text1" value="" id ="text_id"  onBlur="check2()" 
><span>label1</span><br/>
<input type="text" name="text2" value="" id ="text_id1"  
onBlur="check3()"><span>label2</span><br/>
<cfinput name="submit" value="submit" id="submit_1" type='submit'><br/>
</cfform>

<script type="text/javascript">
function funcone(){
if(document.form1.id_check.checked)
{
        document.form1.text_id.disabled = true;
        document.form1.text_id1.disabled = true;
        return false;
}
else{return true;}
}
function check1()
{
        if (document.form1.text_id.disabled = true)
        {
        document.form1.text_id.disabled =false;
        document.form1.text_id1.disabled = false;
        return false;
        }
        else{return true;}
        }
        
        function check2()
        {

        if(document.form1.id_check1.checked || document.form1.id_check2.checked)
        {
                document.form1.text1.focus();
                if(document.form1.text1.value=="" 
||!isNaN(document.form1.text1.value)||document.form1.text1.length !='12')
                {
                        alert("Please enter BankNumber");
                        document.form1.text1.focus();
                }else {return true;}
}
function check3()
{
                if(document.form1.text1.value!="" 
||!isNaN(document.form1.text1.value))
                {
                        if(document.form1.text2.value="" || 
isNaN(document.form1.text2.value))
                        {
                                alert("Please enter Routing Number");
                                document.form1.text2.focus();
                                return false;
                        }
                        else {return true;}
                }
                }
      
}
</script> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319588
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to