/    Sign up×
Community /Pin to ProfileBookmark

paste content in input field ?

Hi,

I have a user register form and the content of each input field is taken by a javascript file and processed. However, when I paste the password into the “retype password” field it complains they are different !? If I retype it, then it’s OK.
Do you have any clue what the problem might be… ?

Thanks,
Pesho

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@trielephantJul 25.2007 — Do you have sample code? I don't quite understand what you are trying to accomplish.
Copy linkTweet thisAlerts:
@Pesho318iauthorJul 25.2007 — well, this is a part of my input form:

[CODE]<tr>
<td><div class="content">Password:</div></td>
<td><input type="password" id="password1" size="20" maxlength="15"> </td>
</tr>
<tr>
<td><div class="content">Password(again):</div></td>
<td><input type="password" id="password2" size="20" maxlength="15"> </td>
</tr>[/CODE]


from the JavaScript I get both values using document.getElementById("password1").value and document.getElementById("password2").value

then make an asynchronous request to a .php file where I compare both passwords.

If I type them in the input fields it works fine.

However, if I paste the second password, it says they are different.
Copy linkTweet thisAlerts:
@trielephantJul 25.2007 — Are you pasting into both fields from a plaintext source or are you typing the password into the first then trying to copy from there and paste into the second? If the latter, AFAIK this is impossible. For security purposes the text typed into a type="password" input cannot be copied correctly. If you are, for example, typing the password into a notepad file, copying it, and pasting into both, it should work. If that isn't working, I'd really need to look at your PHP validation script.
×

Success!

Help @Pesho318i spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...