/    Sign up×
Community /Pin to ProfileBookmark

help with code for password (pretty please lol)

[B]basically I want to not run the code if the choice is not y
password3=prompt(‘ please reenter password’,”); [/B]

[U]The code[/U]

if (password2!=password && password2!=null && password2!=”)
{
var choice = prompt(“Do you want to try again? If not register a new username and password on the registration page? (Y/N)?”,””);
choice = choice.toUpperCase();
}

if (choice != “Y”);
{
password3=prompt(‘ please reenter password’,”);
}

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@simontuxJun 23.2006 — How about something like this........

<i>
</i>if (password2 != password &amp;&amp; password2 != null &amp;&amp; password2 != '')
{
question = confirm("Do you want to try again? If not register a new username and password on the registration page?")
if (question !="0"){
password3= prompt('please reenter password','');
}
}
Copy linkTweet thisAlerts:
@JulianJJun 23.2006 — Small nitpick. What's wrong with

if ( password2 != password )

I am assuming that people cannot pick a password that is null or blank... I know, a nitpick...

Julian
×

Success!

Help @newscripter 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.19,
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,
)...