Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. SharePoint
  4. SharePoint Designer 2010 - Disable Textbox when Checkbox = True on EditForm.aspx

SharePoint Designer 2010 - Disable Textbox when Checkbox = True on EditForm.aspx

Scheduled Pinned Locked Moved SharePoint
javascriptsharepointcomtoolshelp
2 Posts 2 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    LeslieC
    wrote on last edited by
    #1

    I'm using the following script (found on line) to disable a multi-line text box form field control on a custom EditForm.aspx page using SharePoint Designer:

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
    <script type="text/javascript">

    $(document).ready(function() {
    // add change handler
    $("input[title='chkBox']").change(function() {
    MasterSelectChange();
    });
    // call the change function to set up form for first display:
    MasterSelectChange();
    });

    function MasterSelectChange()
    {
    var thisVal = $("input[ID='chkBox']").val();
    if(thisVal == "True")
    {
    $("select[ID='Comments']").enabled="True";
    }
    else
    {
    $("select[ID='Comments']").enabled="False";
    }
    }
    </script>

    I don't get an error and can't figure out why it isn't working. Does anyone have a similar solution or see why this script won't work?

    Thanks!

    L 1 Reply Last reply
    0
    • L LeslieC

      I'm using the following script (found on line) to disable a multi-line text box form field control on a custom EditForm.aspx page using SharePoint Designer:

      <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
      <script type="text/javascript">

      $(document).ready(function() {
      // add change handler
      $("input[title='chkBox']").change(function() {
      MasterSelectChange();
      });
      // call the change function to set up form for first display:
      MasterSelectChange();
      });

      function MasterSelectChange()
      {
      var thisVal = $("input[ID='chkBox']").val();
      if(thisVal == "True")
      {
      $("select[ID='Comments']").enabled="True";
      }
      else
      {
      $("select[ID='Comments']").enabled="False";
      }
      }
      </script>

      I don't get an error and can't figure out why it isn't working. Does anyone have a similar solution or see why this script won't work?

      Thanks!

      L Offline
      L Offline
      Lin ann
      wrote on last edited by
      #2

      try using txt.Attributes.Clear("disabled");

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups