...

View Full Version : Error With Select and Description



7079
10-11-2006, 07:58 PM
<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!

Arty Effem
10-11-2006, 09:12 PM
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...

7079
10-11-2006, 10:05 PM
<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

7079
10-12-2006, 02:51 PM
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

7079
10-12-2006, 07:41 PM
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

Arty Effem
10-12-2006, 11:15 PM
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.

7079
10-14-2006, 09:44 PM
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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum