Problem related to Master Pages

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • navneetkaur
    New Member
    • Sep 2007
    • 45

    Problem related to Master Pages

    hello every1...
    i want to add a counter on the textbox which is having highest limit 250..'d on every enter of letter it should be decreased by 1...
    i have added 1 javascript function which is doing that...but arguments that i am passing is like this.form.textb ox1.text but because of master page control hierarchy changes it does not able to find control....
    tell me solution....
    any idea is appreciated....
    thanx
  • shweta123
    Recognized Expert Contributor
    • Nov 2006
    • 692

    #2
    Hi,

    Can you please mention any error you are getting in javascript function?
    From the post it is not clear where are you stcuk up.
    Are you calling your javasript function OnTextChanged event of textbox?


    Originally posted by navneetkaur
    hello every1...
    i want to add a counter on the textbox which is having highest limit 250..'d on every enter of letter it should be decreased by 1...
    i have added 1 javascript function which is doing that...but arguments that i am passing is like this.form.textb ox1.text but because of master page control hierarchy changes it does not able to find control....
    tell me solution....
    any idea is appreciated....
    thanx

    Comment

    • navneetkaur
      New Member
      • Sep 2007
      • 45

      #3
      Originally posted by shweta123
      Hi,

      Can you please mention any error you are getting in javascript function?
      From the post it is not clear where are you stcuk up.
      Are you calling your javasript function OnTextChanged event of textbox?
      hello

      no m not getting any error function is like that
      Code:
      function limitText(limitField, limitCount, limitNum) 
      {
      	if (limitField.value.length > limitNum) 
                     {
      		limitField.value = limitField.value.substring(0, limitNum);
                     } 
                     else {
      		limitCount.value = limitNum - limitField.value.length;
      	      }
      }
      'd m calling this function

      Code:
      <textarea id="project_title1" runat="server" name="project_title1"
                              style="height: 40px; width: 337px;" onkeydown=
      "limitText(this.Form.project_title1,this.Form.countdown3,150);" 
                                 onkeyup="limitText(this.Form.project_title1,this.Form.countdown3,150);" ></textarea><br />
      it is just when i enter in this textarea there is a counter which initial value is 150 but when we enter something it should be decreased by 1.....no 1 can enter more than 150 characters...

      Comment

      • Shashi Sadasivan
        Recognized Expert Top Contributor
        • Aug 2007
        • 1435

        #4
        I belive you can set the property of the text box control to set its maximum length.
        not sure if it is a text area or text box.

        If your query is javascript related please post your query in the javascript forums so that more javascript proficient people can help you.

        Firefox and now IE too show you javascript errors.

        cheers.

        Comment

        • navneetkaur
          New Member
          • Sep 2007
          • 45

          #5
          Originally posted by Shashi Sadasivan
          I belive you can set the property of the text box control to set its maximum length.
          not sure if it is a text area or text box.

          If your query is javascript related please post your query in the javascript forums so that more javascript proficient people can help you.

          Firefox and now IE too show you javascript errors.

          cheers.

          sir
          i have seen textarea doesnot have this property maximum length.....'d if i implement this same code in simple web form without master pages it works fine but i suppose problem with this because of master pages....as it changes control hierarchy....'d in IE it shows error
          Code:
          this.form.project_title1 value is null or not an object
          so please help me....
          m waiting if u hv knowledge of master pages...1 thing is sure this is because master pages...so i can not able to tranform this problem in javascript forum....

          thanx......

          Comment

          Working...