Just another rainy day
Posts: 1
10 credits Members referred : 0
« on: Sep 12, 2008, 02:08:47 am »
here's what i'm trying to complete
An interface should be written that displays a list of all users that have been imported. When displaying the list of users, the password field should be represented with a blank input box, allowing the user's password to be changed. Underneath the table there will be a "Save" button, which when pressed will change all the passwords for those users who have a password filled in and reload the page.
When someone has input several passwords, each password needs to be validated in javascript prior to submit to ensure that it is of a minimum length of 4 characters. If it is not, the Save button should not work and a popup should explain what the problem is.
here's what i have so far....I'm pretty new to php and javascript so don't know what i'm missing...when i click save i can't get the javascript to pull the values from the password fields in the php while loop....just says that they're ok and save....which is another issue, i can't figure out how to update the entire row accordingly if needed.... any help is greatly appreciated
<html> <head> <title>Matt's Password Changing Page</title> <script type="text/javascript"> function validate(f){ var passwords = f.password; var theID = f.userID;
for (i=0;i<passwords.length;i++){ if (passwords[i].length < 4) { alert("Password Length is Less than 4 characters!"); passwords[i].focus(); return false; } else if(passwords[i].value=='') {