seany123 Posted September 21, 2011 Share Posted September 21, 2011 I have this code with clears the input box onclick... <input type="text" name="username" value="Username" onclick="value=''"/> however is there any way to use php to get the value of username, before its posted? that way i can make it so it only clears if the value of username is "username" Quote Link to comment https://forums.phpfreaks.com/topic/247609-can-i-use-value-of-a-form-without-posting/ Share on other sites More sharing options...
requinix Posted September 21, 2011 Share Posted September 21, 2011 however is there any way to use php to get the value of username, before its posted? No. that way i can make it so it only clears if the value of username is "username" You don't use PHP for that. Use JavaScript. More specifically, modify the onclick you already have. onclick="if (value=='Username') value='';" Quote Link to comment https://forums.phpfreaks.com/topic/247609-can-i-use-value-of-a-form-without-posting/#findComment-1271520 Share on other sites More sharing options...
seany123 Posted September 21, 2011 Author Share Posted September 21, 2011 ah right okay thankyou!! Quote Link to comment https://forums.phpfreaks.com/topic/247609-can-i-use-value-of-a-form-without-posting/#findComment-1271521 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.