Forum Moderators: open

Message Too Old, No Replies

How to force typed-in rather than cut'n'paste

into 'enter your password again' type fields

         

Mr Bo Jangles

6:34 am on Nov 8, 2003 (gmt 0)

10+ Year Member



Hi all,
I saw a site the other day that had those duplicate fields for "enter your password again" function, BUT this one indicated that:"Please don't just cut'n'paste it in - that won't work"

I didn't test it, but can this be done?
I would like to implement this if it can be done i.e. how can I force the user to actually *type* it in twice?

thanks,

Mr Bo Jangles

keyplyr

6:36 am on Nov 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month




function disableselect(e){
return false
}
function reEnable(){
return true
}

//if IE4+
document.onselectstart=new Function ("return false")

//if NS6
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}

Mr Bo Jangles

6:52 am on Nov 8, 2003 (gmt 0)

10+ Year Member



many thanks keyplyr, and can I ask, is this 'safe' code? i.e. I'm not an expert in all this, but what I'm asking is will it 'degrade' gracefully for any browser or platform that the code won't work with i.e. will they be still able to get their data in the field?

keyplyr

7:21 am on Nov 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Support should be across the board. Just wrap it in tags like this:

<script type="text/javascript">
[i]code here[/i]
</script>

Or of course if you were using it on numerous pages, you can create a text file containing that code (without those tags), rename it something like nopaste.js and call it from the <head> section like this:

<script type="text/javascript" src="/nopaste.js"></script>

<added>
Very, very old browsers built prior to JavaScript and those users that may have JS disabled, will just experience your form as normal.
</added>

Mr Bo Jangles

7:37 am on Nov 8, 2003 (gmt 0)

10+ Year Member



great many thanks!