Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Jul 2006
    Posts
    45
    Thanks
    1
    Thanked 0 Times in 0 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
    Banned
    Join Date
    May 2006
    Location
    England
    Posts
    664
    Thanks
    0
    Thanked 84 Times in 84 Posts
    Quote 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...

  • #3
    New Coder
    Join Date
    Jul 2006
    Posts
    45
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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

  • #4
    New Coder
    Join Date
    Jul 2006
    Posts
    45
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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

  • #5
    New Coder
    Join Date
    Jul 2006
    Posts
    45
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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

  • #6
    Banned
    Join Date
    May 2006
    Location
    England
    Posts
    664
    Thanks
    0
    Thanked 84 Times in 84 Posts
    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.

  • #7
    New Coder
    Join Date
    Jul 2006
    Posts
    45
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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


  •  

    Posting Permissions

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