mwl707 Posted October 9, 2009 Share Posted October 9, 2009 Hi I want to display a form pre-filled with some data. I am using javascript to do this. But after pre-filling the form i want to 'protect' one of the input boxes so the data cannot be changed. is there any way I can do this ?. I know I could remove the input box in question and just add the data in a div area etc.. but i would like to keep the continuity of the form . Any help or suggestions would be much appreciated thanks Quote Link to comment Share on other sites More sharing options...
johnsmith153 Posted October 9, 2009 Share Posted October 9, 2009 You could, but it would never be secure. ANYTHING that you do in a HTML form can be changed. Just because you show the user 2 input boxes rather than 3 doesn't mean a hacker can't send the 3 bits of data. It is all down to the PHP server-side. The same if you offer them a dropdown to choose 1,2 or 3 - it must be set in the receiving server-side script to only allow 1,2,3 etc. If you want to do it then this will show you the difference: <input style="visibility:hidden" type="text" value="hello"/> <input type="text" value="hi there"/> Quote Link to comment Share on other sites More sharing options...
eugene2009 Posted October 28, 2009 Share Posted October 28, 2009 is this what your talking about? ? <input type=text name="NAME_OF_INPUT" readonly="readonly" value="PUT_TEXT_HERE"> REPLACE "NAME_OF_INPUT" and "PUT_TEXT_HERE" with whatever values you want. Quote Link to comment 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.