SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jan 2007
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    enable a textbox by verify the user using checkbox

    hi to all,

    i need help.
    i have one textbox and one checkbox.textbox is disabled.i have to enable the textbox by verify the user using checkbox.for this i have a pop up window where user is verified.after submit this window,i have to enable textbox.

    here is my code

    <asp:TextBox ID="pcard" runat="server" Enabled="false"></asp:TextBox>
    <a href="javascript:;" onclick="window.open('pre_card.aspx?textbox=pcard','cal','width=250,height=150,left=270,top=180')">
    <asp:CheckBox ID="pno" runat="server" onclick="javascript:enable();" /></a>

    function enable()
    {

    var v;
    v = document.form1.pcard.value;

    if(v == "abc")
    {
    document.form1.pcard.disabled=false;
    document.form1.pcard.value ="";
    }
    else
    document.form1.pcard.disabled=true;
    }
    this works fine after getting the value of textbox.
    plz tell me, on which event i have call this function.
    onfocus,onblur dosen't work due to textbos is disable.

    thanks a lot.

  2. #2
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your explaination isn't very clear. Basically you want to validate a field that is disabled, using a checkbox, but why would you want to do that?



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •