Jump to content

Input box


mwl707

Recommended Posts

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 

Link to comment
Share on other sites

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"/>

Link to comment
Share on other sites

  • 3 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.