Yes, you are confusing client-side and server-side scripting. This:
PHP Code:
<input type="submit" name="submit" class="formTextbox" value="Submit" onClick="<?php
if ($qty_oak >= '1'){
echo "return confirm('something in text box')\">";} else{
echo "return confirm('nothing in text box')\">";}
?>
will output the following static HTML:
HTML Code:
<input type="submit" name="submit" class="formTextbox" value="Submit" onClick="return confirm('something in text box')">
if your PHP variable $qty_oak is >= 1. Otherwise it will return a confirm prompt with the other text, regardless of what is in the text input.
PHP has no control over the page once it has loaded. As soon as PHP sends the page to the user, that's its job done and anything dynamic must be solely handled by javascript (unless you're using AJAX). So the answer to How do I get php to recognize that something was put in the text box after the page was loaded? is "you can't". That's javascript's job. I think what you want is to do this:
HTML Code:
<input type="text" class="formSmallTextbox" name="a_number" size="4" value="">
<input type="submit" name="submit" class="formTextbox" value="Submit" onClick="if (document.getElementsByName('a_number')[0].value == '') return confirm('nothing in text box'); else return confirm('something in textbox');">
That, however, is horribly messy and you should consider using unobtrusive javascript.
Bookmarks