Zeyber Posted December 1, 2007 Share Posted December 1, 2007 This is a sort of HTML/PHP question, well questions: 1. How do I change what a submit button says in a form without changing the value? 2. How do I set a minimum/maximum amount of characters in a text field? Quote Link to comment https://forums.phpfreaks.com/topic/79747-solved-submit-button-label/ Share on other sites More sharing options...
wsantos Posted December 1, 2007 Share Posted December 1, 2007 1. I have no idea. I always use value attribute for that. You can try building your own class...but that would be a tedious work. 2. There is no min length I am aware of only maxlength. Quote Link to comment https://forums.phpfreaks.com/topic/79747-solved-submit-button-label/#findComment-403853 Share on other sites More sharing options...
revraz Posted December 1, 2007 Share Posted December 1, 2007 These are both HTML questions. 1. Change the value= to what you want it to say on the page. The name= is what you use to read when the button is pressed. 2. Set the Input size= and maxlength= but you can't set a minimum. Use code to verify data. Quote Link to comment https://forums.phpfreaks.com/topic/79747-solved-submit-button-label/#findComment-403861 Share on other sites More sharing options...
Zeyber Posted December 1, 2007 Author Share Posted December 1, 2007 1. If I change the value it changes the variables sent to the next page when you use PHP to get it. 2. So I can use PHP to check the minimum length? Quote Link to comment https://forums.phpfreaks.com/topic/79747-solved-submit-button-label/#findComment-403865 Share on other sites More sharing options...
revraz Posted December 1, 2007 Share Posted December 1, 2007 1. No, Name does 2. Yes 1. If I change the value it changes the variables sent to the next page when you use PHP to get it. 2. So I can use PHP to check the minimum length? Quote Link to comment https://forums.phpfreaks.com/topic/79747-solved-submit-button-label/#findComment-403867 Share on other sites More sharing options...
wsantos Posted December 1, 2007 Share Posted December 1, 2007 1. No it wont as long as you are pulling the info from the name attribute. 2. Yes if(strlen($str)>=$minlength { } Quote Link to comment https://forums.phpfreaks.com/topic/79747-solved-submit-button-label/#findComment-403868 Share on other sites More sharing options...
Zeyber Posted December 1, 2007 Author Share Posted December 1, 2007 Ok thanks guys. Can you please show me what that code: if(strlen($str)>=$minlength { } Would look like with: <input type="password" name="Password" /> ? Quote Link to comment https://forums.phpfreaks.com/topic/79747-solved-submit-button-label/#findComment-403875 Share on other sites More sharing options...
revraz Posted December 1, 2007 Share Posted December 1, 2007 It is pulled from the page using the $_POST['Password'] array. $minlength = 8; $password = $_POST['Password']; if(strlen($password)>=$minlength) { echo "Good"; } else { echo "Too Short"; } Quote Link to comment https://forums.phpfreaks.com/topic/79747-solved-submit-button-label/#findComment-403879 Share on other sites More sharing options...
Zeyber Posted December 1, 2007 Author Share Posted December 1, 2007 Thanks alot! I guess that answers my questions. Quote Link to comment https://forums.phpfreaks.com/topic/79747-solved-submit-button-label/#findComment-403880 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.