TheNavigator Posted December 2, 2012 Share Posted December 2, 2012 I don't know how that's made to be honest, maybe it's not even Javascript, but I saw that at www.joymax.com When the refresh button is pressed, or any link is pressed, or even a Javascript was activated in the URL box, the password field is cleared. This is to prevent those scripts that reveal password fields and etc, while (of course), the data is still received by the php script behind. My question is, any hints on how to do so? All what I can do with Javascript is read it to be honest, so I need some help on what to do to achieve such objective. Any help is greatly appreciated. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/271480-clearing-password-fields-on-any-refresh-attempt/ Share on other sites More sharing options...
MDCode Posted December 2, 2012 Share Posted December 2, 2012 (edited) It's not too clear as to what you want but you can try: <!-- Submitting form --> <form onsubmit="document.getElementByName('name of whatever field').value = ''"></form> <!-- Clicking button (Also works on links) --> <input type="button" onclick="document.getElementByName('name of whatever field').value = ''" /> Edited December 2, 2012 by SocialCloud Quote Link to comment https://forums.phpfreaks.com/topic/271480-clearing-password-fields-on-any-refresh-attempt/#findComment-1396930 Share on other sites More sharing options...
TheNavigator Posted December 2, 2012 Author Share Posted December 2, 2012 I understand what you wrote there, but what I need to achieve is to prevent those Javascripts to reveal the password thing. Joymax site seems like they've removed this feature though :| Maybe it's not that much needed? Quote Link to comment https://forums.phpfreaks.com/topic/271480-clearing-password-fields-on-any-refresh-attempt/#findComment-1396941 Share on other sites More sharing options...
MDCode Posted December 2, 2012 Share Posted December 2, 2012 What do you mean by reveal? Are you using a input type of text instead of password? Anyone can edit your html with add-ons to browsers Quote Link to comment https://forums.phpfreaks.com/topic/271480-clearing-password-fields-on-any-refresh-attempt/#findComment-1396951 Share on other sites More sharing options...
Christian F. Posted December 2, 2012 Share Posted December 2, 2012 Heck, if you use Opera you don't even need an add-on. Just "view source", do the changes, and hit F5. One of the main rules in web development is: Never trust the user. Quote Link to comment https://forums.phpfreaks.com/topic/271480-clearing-password-fields-on-any-refresh-attempt/#findComment-1396975 Share on other sites More sharing options...
TheNavigator Posted December 2, 2012 Author Share Posted December 2, 2012 Heck, if you use Opera you don't even need an add-on. Just "view source", do the changes, and hit F5. One of the main rules in web development is: Forgot that to be honest. It looks like that's the main reason joymax just discontinued it. Thanks then. I won't add that. Quote Link to comment https://forums.phpfreaks.com/topic/271480-clearing-password-fields-on-any-refresh-attempt/#findComment-1397011 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.