php_begins Posted December 13, 2011 Share Posted December 13, 2011 can u make a form field not copyable. I have the following field. but i do not want users to able to copy and paste it.. <input type="text" size="40" name="security_code" value="72o936GRWD" readonly=""> Quote Link to comment https://forums.phpfreaks.com/topic/253104-form-field-not-copyable/ Share on other sites More sharing options...
Drummin Posted December 13, 2011 Share Posted December 13, 2011 Make it a hidden field. Any text can be highlighted and copied. <input type="hidden" size="40" name="security_code" value="72o936GRWD" readonly=""> Quote Link to comment https://forums.phpfreaks.com/topic/253104-form-field-not-copyable/#findComment-1297561 Share on other sites More sharing options...
premiso Posted December 13, 2011 Share Posted December 13, 2011 I would say trying is just wasting your time. Perhaps a better way of doing it is available. Mind explaining what the security_code does and why you do not want people to be able to copy it? Quote Link to comment https://forums.phpfreaks.com/topic/253104-form-field-not-copyable/#findComment-1297562 Share on other sites More sharing options...
SergeiSS Posted December 13, 2011 Share Posted December 13, 2011 You may put transparent DIV above this input. Set DIV's size equal to input's size, set z-index of this DIV more... But I can't understand. User see it and can enter these letters into another input, text editor etc. It's possible also look into the page code and copy this code very easy. Quote Link to comment https://forums.phpfreaks.com/topic/253104-form-field-not-copyable/#findComment-1297564 Share on other sites More sharing options...
Winstons Posted December 13, 2011 Share Posted December 13, 2011 You can look at here http://stackoverflow.com/questions/3779534/how-to-disable-text-selection-with-css-or-js Quote Link to comment https://forums.phpfreaks.com/topic/253104-form-field-not-copyable/#findComment-1297568 Share on other sites More sharing options...
php_begins Posted December 13, 2011 Author Share Posted December 13, 2011 the secuirty code is autogenerated random text and numbers. I want it to able to use it like CAPTCHA. Is there an alternate method..can i make that code into an image or something? Quote Link to comment https://forums.phpfreaks.com/topic/253104-form-field-not-copyable/#findComment-1297572 Share on other sites More sharing options...
litebearer Posted December 13, 2011 Share Posted December 13, 2011 Presuming you (1) do NOT want the user to see the 'security code'; and (2) you want to pass the 'security code' to your processing and/or other page, simply try storing it in a session variable Quote Link to comment https://forums.phpfreaks.com/topic/253104-form-field-not-copyable/#findComment-1297591 Share on other sites More sharing options...
Philip Posted December 13, 2011 Share Posted December 13, 2011 http://www.phpfreaks.com/tutorial/php-add-text-to-image If you don't store it as an image, it'd be super easy for a bot to scrape it and thus make your field pointless. Quote Link to comment https://forums.phpfreaks.com/topic/253104-form-field-not-copyable/#findComment-1297593 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.