eits Posted September 9, 2007 Share Posted September 9, 2007 OK - I am wondering if I can get text from textfield before submit is pressed? I want to add text in textfield to a database entry so I was thinking: <input name="hoursworked" type="hidden" id="hoursworked" value="<?php echo $row_custdb['hoursworked'] +hourstodecimal($_POST['hourstoday']); ?>"> but the last bit past hourstodecimal doesnt work as the form hasnt been submitted so keeps returning 0. Link to comment https://forums.phpfreaks.com/topic/68598-get-text-from-textfield-before-submit-is-pressed/ Share on other sites More sharing options...
monkeybidz Posted September 9, 2007 Share Posted September 9, 2007 Your code does not show, post it in plain text so that it it not removed. I saw it earlier. Your using $_POST, but the variable has not yet posted untill the submit button has been hit. Link to comment https://forums.phpfreaks.com/topic/68598-get-text-from-textfield-before-submit-is-pressed/#findComment-344827 Share on other sites More sharing options...
eits Posted September 9, 2007 Author Share Posted September 9, 2007 Sorry, can you ellaborate? Link to comment https://forums.phpfreaks.com/topic/68598-get-text-from-textfield-before-submit-is-pressed/#findComment-344861 Share on other sites More sharing options...
monkeybidz Posted September 9, 2007 Share Posted September 9, 2007 Can you try this: +$hourstodecimal($_POST['hourstoday']); Link to comment https://forums.phpfreaks.com/topic/68598-get-text-from-textfield-before-submit-is-pressed/#findComment-344934 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.