/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Java var to hidden form

Hello,
Im somewhat of a beginner to java so dont expect me to know everything you say to me ? i do work well with html/php.

I have a registration page in which i have a password strength meter, this meter gives of readings of they’re current typed in text in the password field: weak moderate moderate strong

i would like to be able to get the FINAL reading into a hidden form variable so i can validate it via the next page (php). If you know of any snippets that could help me do this that would be great…

…if its any easier maybe i can do something like this, except functional ?

[CODE]while(pwstr!=’strong’)
{
document.form.submitbutton.disable=true;
}
[/CODE]

Thanks alot in advanced!
Jeremy A

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@FangJul 23.2008 — It's JavaScript not Java. They are 2 different languages.

Invert your logic: the submit button is disabled initially and re-enabled when the password is acceptable.
Copy linkTweet thisAlerts:
@JeremyAauthorJul 23.2008 — So how exactly do i script that?

i've tried variations of the above code none have worked.
Copy linkTweet thisAlerts:
@FangJul 23.2008 — <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>strength test</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<script type="text/javascript">
function strength(obj) {
var strength='weak';
// do something with obj.value
if(strength==='strong') {
document.form1['submit'].removeAttribute('disabled');
}
}
window.onload=function() {
document.form1['submit'].disabled=true;
};
</script>

<style type="text/css">

</style>

</head>
<body>
<form action="#" name="form1">
<input type="text" name="pw" onblur="strength(this);">
<button type="submit" name="submit">submit</button>
</form>
</body>
</html>
Copy linkTweet thisAlerts:
@JeremyAauthorJul 23.2008 — Thanks alot, worked like a charm ?
×

Success!

Help @JeremyA 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...