mammer
|
| Posted: 06/22/2002, 3:41 PM |
|
The javascript below keeps generating the error message "Error: document.QuoteGen.Description is null or not an object". I get the same error no matter if the script is in the form's header or within the Before Show event (in the latter case surrounded by %> and <%). Anyone else seeing this and or have the answer? The form_name and field_name are spelled correctly and the case matches as well. I'm using CC 2.05 with ASP w/templates running on XPPro/IIS/Access 2002/IE6.0.26
<script language="javascript">
alert("Description value=" + document.forms['QuoteGen'].elements['Description'].value);
</script>
I've also tried it with this variant:
alert("Description value=" + document.QuoteGen.Description.value);
Thanks!
|
|
|
 |
Don
|
| Posted: 06/25/2002, 1:11 AM |
|
Hello,
have you tried
document.QuoteGen.Description.value?
Make sure that Description field is of updatable type.
|
|
|
 |
Labs4.com
|
| Posted: 06/25/2002, 5:21 AM |
|
because you call alert before form and it's not inside a function value is not set yet and you get an error
there are two solutions:
1) put this code into head of the page as function like
<script language="javascript">
function showDescription() {
alert("Description value=" + document.forms['QuoteGen'].elements['Description'].value)
}
</script>
and call it where you need it (probably <body onLoad="showDescription();">
2) hang the code on some element like
<form name="QuoteGen">
<input type="text" name="Description" value="minime">
<input type="button" name="button" value="click" onClick="alert('Description value=' + document.forms['QuoteGen'].elements['Description'].value);">
</form>
Doesn't matter if you use DOM method
document.forms['QuoteGen'].elements['Description'].value
or pure javascript
document.QuoteGen.Description.value
both of them works.
Josef
|
|
|
 |
|