Skip to content
Loading
how to disable text box depends on user choosing text box?
  • Hi ,


     i wanna set textbox  when the user  enter lodging means at  that time daily  allowance is read only mode after add  the details   daily allowance ll  show as normal.
  • when you want to call javascript code? what exactly you like to do?

    Regards,
    Iftikar
  • Hi Freind,


    How to call  javascript in my asp.net code?
  • I have modified the script, please check now

    function EnableDisable() 
     {
            var lodging = document.getElementById("<%= TxtLdg.ClientID %>").value;
            var foodClaim = document.getElementById("<%= TxtFoAl.ClientID %>").value;
            var dailyAllow = document.getElementById("<%= TxtFdAl.ClientID %>").value;
     
            if (lodging != "" && foodClaim != "" && dailyAllow=="") 
            {
                EnableDisableTextBox("<%= TxtFdAl.ClientID %>", false);
                EnableDisableTextBox("<%= TxtLdg.ClientID  %>", true);
                EnableDisableTextBox("<%= TxtFoAl.ClientID %>", true);
            } else if (lodging == "" && foodClaim == "" && dailyAllow != "") {
                EnableDisableTextBox("<%= TxtLdg.ClientID  %>", false);
                EnableDisableTextBox("<%= TxtFoAl.ClientID %>", false);
                EnableDisableTextBox("<%= TxtFdAl.ClientID %>", true);
            } else {
                EnableDisableTextBox("<%= TxtLdg.ClientID  %>", true);
                EnableDisableTextBox("<%= TxtFoAl.ClientID %>", true);
                EnableDisableTextBox("<%= TxtFdAl.ClientID %>", true);
            }            
    }

    Regards,
    Iftikar
  • Hi Iftikar,



    My asp.net code:
    ===========












       

       

        Welcome :
        

       

         
         
         
         
       
                                       
                                   
            
              
             
              
                
              
    Travel Request Bills
          
          

                                          
                                       

              
                
                
                   
                    
                    
                    
                    
                    
                   
                   
                   
                     
                     
                     
                     
                   
                
                   
                     
                     
                     
                     
                   
                   
                     
                     
                     
                     
                    
                   
                     
                     
                     
                     
                   
                   
                     
                     
                     
                     
                   
               
               
    Departure Date
                    
                    
    No.Of.days
                    <%-- //--%>
                    
                    
    From
                     
                     
    To
                     
                     
    Rail/Bus Fare
                     
                     
    Bill No Only Train
                     
                     
    Lodging
                     
                     
    Food Allowance
                     
                     
    Fixed Allowance
                     
                     
    Transit Allowance
                     
                     
    Postal/Courier
                     
                     
    Internet Bills
                     
                     

             

                   
                   
             
                     
             
                   
                   
                 

  • please share your code

    Regards,
    Iftikar
  • Hi Iftikar,
       When I choose the Lodging and food claim ,daily allowance also enable its not on read only mode.
     what can i do?
  • what issue you are getting? Can you share your code?

    Regards,
    Iftikar
  • Hi Iftikar,
        nt woriknig these  java script  is any other code is there?
  • Hi,
            Try like this

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm4.aspx.cs" Inherits="WebApplication2.WebForm4" %>


       
       
       
       
           
               
               
           
           
               
               
           
           
               
               
           
       
                    Lodging
               
                   
               
                    Food Claim
               
                   
               
                    Daily Allowances
               
                   
               
       
       


    Regards,
    Iftikar