KillZoneZ Posted August 26, 2015 Share Posted August 26, 2015 Basically i want to check through php if a HTML element's attribute value is true, for example: <input id="example" maxlenght="10"(...)/> //This is me imagining how it could be <?php if(#example:maxlenght = 10) { echo "Good to go"; } ?> I'm not sure if i'm clear. Thank You Quote Link to comment https://forums.phpfreaks.com/topic/297944-simple-question-i-think/ Share on other sites More sharing options...
dalecosp Posted August 26, 2015 Share Posted August 26, 2015 So, you're testing a value from a POSTed form?Otherwise, this is a JavaScript task. Quote Link to comment https://forums.phpfreaks.com/topic/297944-simple-question-i-think/#findComment-1519687 Share on other sites More sharing options...
KillZoneZ Posted August 26, 2015 Author Share Posted August 26, 2015 Yes, when the user clicks the submit button it should tell him the lenght of the inputed text is over or below the required Quote Link to comment https://forums.phpfreaks.com/topic/297944-simple-question-i-think/#findComment-1519688 Share on other sites More sharing options...
dalecosp Posted August 26, 2015 Share Posted August 26, 2015 If the action is onSubmit(), then it's JavaScript. Quote Link to comment https://forums.phpfreaks.com/topic/297944-simple-question-i-think/#findComment-1519690 Share on other sites More sharing options...
KillZoneZ Posted August 26, 2015 Author Share Posted August 26, 2015 Oops, i think i posted in the wrong section then, sorry im kinda new to programming. Thanks for the help anyway. Can someone close this topic? Quote Link to comment https://forums.phpfreaks.com/topic/297944-simple-question-i-think/#findComment-1519691 Share on other sites More sharing options...
dalecosp Posted August 26, 2015 Share Posted August 26, 2015 Is there a "delete" option on your OP? (I don't really know if there is, just asking :-) ) Quote Link to comment https://forums.phpfreaks.com/topic/297944-simple-question-i-think/#findComment-1519692 Share on other sites More sharing options...
KillZoneZ Posted August 26, 2015 Author Share Posted August 26, 2015 I dont think so if there is i cant find it Quote Link to comment https://forums.phpfreaks.com/topic/297944-simple-question-i-think/#findComment-1519693 Share on other sites More sharing options...
ginerjm Posted August 26, 2015 Share Posted August 26, 2015 This is a silly question on my part, but since the user/client can't change the attribute why would you need to check it back at the server when the POST/GET data is received? It would be the same as when it was sent out. And if the concern is strictly about the maxlength attribute, then your script s/b doing input validation per se when it receives the input to avoid exactly that kind of web interaction and not be dependent on the html value. Quote Link to comment https://forums.phpfreaks.com/topic/297944-simple-question-i-think/#findComment-1519694 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.