php / JS / DOM question
| From: | jonathan | Date: | Thu, 29 Dec 2005 21:45:23 +0000 |
| Subject: | php / JS / DOM question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-227983@lists.php.net to get a copy of this message | ||
I know that this is more of a Javascript / DOM question but I cannot for the life of me figure this out:
I have this form:
<form name="query_form">
<input type="text" name="q"></input>
<input type="button" onclick="drawImg('A',document.forms['query_form'].elements['q']);" value="Search"></input>
</form>
When the user clicks on the button, I want the text that is in input elment 'q' to be sent to the Javascript function drawImg but when I debug it via alerts, it appears to be NULL. Looking at the examples online, I feel like this should work. Does anybody know why this might not be working correctly?
-jonathan