Print Page | Close Window

Javascript Null, not an Object

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Web Design Discussion
Forum Description: Discussion on web design and development subjects.
URL: https://forums.webwiz.net/forum_posts.asp?TID=17174
Printed Date: 29 March 2026 at 2:58pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Javascript Null, not an Object
Posted By: ub3rl337ch3ch
Subject: Javascript Null, not an Object
Date Posted: 07 November 2005 at 11:10pm
I'm having some trouble with a bit of js in an onchange event. Basically, if someone changes the Pno field, i want to send the new value of Pno to a second form, the submit that form. I've done this bazillions of times before, i know it works... but it won't It keeps giving me a 'null or not an object' error for the "document.getElementById('claimstart').Pno" part...
 
<form name="claimlayer" id="claimlayerform">
<input name="Pno" value="1940B" onchange="document.getElementById('claimstart').Pno.value = this.value; document.getElementById('claimstart').submit()">
</form>
 
<form method="POST" action="form.asp" name="claimstart" id="claimstart" target="postwindow">
<input name="Pno" size="10">
</form>
 
any ideas why it's being a pAngryAngry?



Replies:
Posted By: ub3rl337ch3ch
Date Posted: 08 November 2005 at 1:34am
weeeeeell... i slapped the second form above the first and it decided to work...
 
am i just dense? but isnt javascript supposed to be able to see stuff anywhere in the html, not just things above it? and i did make sure that the page was fully loaded and that the secondary form was actually in the source...



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net