Web Analytics Made Easy -
StatCounter Error With Select and Description - CodingForum

Announcement

Collapse
No announcement yet.

Error With Select and Description

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error With Select and Description

    Code:
            
    <script type="text/javascript">
    <!--
    var shortcut=document.myForm;
    var descriptions=new Array();
    //loop through with CF and add descriptions to array
    descriptions[0]="Template Descriptions Area"
    
    descriptions[1]="This letter gives them the idea that you are a polite well mannered person"
    
    
    descriptions[2]="This letter give them the idea that they will be dealing with a major A** HOLE"
    
    
    shortcut.TemplateDescription.value=descriptions[shortcut.TemplateID.selectedIndex]
    function showtext(){
    shortcut.TemplateDescription.value=descriptions[shortcut.TemplateID.selectedIndex]
    }
    //-->
    </script>
    I get a message that says: Done, but with errors on page

    The error is: 'shortcut.TemplateDescription' is null or not an object

    Please tell me what the problem is, I cannot for the life of me figure it out.

    Thank you in advance!

  • #2
    Originally posted by 7079 View Post
    I get a message that says: Done, but with errors on page

    The error is: 'shortcut.TemplateDescription' is null or not an object

    Please tell me what the problem is, I cannot for the life of me figure it out.
    shortcut.TemplateDescription does not exist, at least not at the time that it is referenced, but as you haven't shown the form it's not possible to say exactly why...

    Comment


    • #3
      Code:
      <table width="725" border="0" cellspacing="0" cellpadding="0" class="bucket_bold">
                <tr>
                  <td width="128" height="30">Template Name :</td>
                  <td width="597"><select name="TemplateID" class="form_box_white" size="1" onChange="showtext()">
                      <option value="">- Please Select -</option>
                      
                        <option value="1">Nice Letter Credit Bureau</option>
                      
                        <option value="2">Asshole Letter Credit Bureau</option>
                      
                    </select></td>
                </tr>
                <tr>
                  <td height="71">Template Descrip.</td>
                  <td><textarea name="TemplateDescription" cols="75" rows="3" class="terms"></textarea>
                    </label></td>
                </tr>
              </table>
      Sorry, i forgot to include the form in the original post.

      Thanks,

      7079

      Comment


      • #4
        I am still looking for help on this error if anyone out there can help. I have been trying to figure this error out for quite some time and have had no luck in doing so.

        I look forward to your response!

        7079

        Comment


        • #5
          I played with this code some more, no success. I don't understand why I am getting the error I am getting.

          Still looking for help!

          Thanks,

          7079

          Comment


          • #6
            I can't see any form tags and I can't see the position of the script relative to the form.
            A script written in this way will fail if positioned above the form.
            Ensure that the form is named 'myForm'.
            If that doesn't work, create a complete minimal test document that demonstrates the problem, and post it in its entirety.

            Comment


            • #7
              Moving the script to the bottom of the form worked out perfectly! I appreciate you taking the time to look at my situation and I apologize for not posting the complete code. I diddn't realize you needed to look at the entire form, sorry!

              7079

              Comment

              Working...
              X