Results 1 to 4 of 4

Thread: Verify Password

  1. #1
    Join Date
    May 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Verify Password

    Ok. I just joined than, and i need the answer to the most simplest question.
    This is my code for signing up to my website:
    <!--webbot bot="HTMLMarkup" startspan --><form method="post" enctype="multipart/form-data" action="http://pub12.bravenet.com/emailfwd/senddata.php">
    <input type="hidden" name="usernum" value="948392434">
    <input type="hidden" name="cpv" value="2">
    <!-- DO NOT CHANGE OR REMOVE THE 3 TAGS ABOVE THIS COMMENT-->

    <table border="0" cellpadding="0" cellspacing="0" align="center">
    <tr>
    <td><h3 style="border-bottom:0px solid black;">Sign Up</h3></td>
    </tr>
    <tr>
    <td>

    <label for="username" style="display:block;margin-bottom:5px;">Preferred Username:</label><input type="text" name="username" id="username" value="" maxlength="" style="width:80px;"><div style="clear:left;height:20px;"> </div>

    <label for="password" style="display:block;margin-bottom:5px;">Preffered Password:</label><input type="password" name="password" id="password" value="" maxlength="" style="width:80px;"><div style="clear:left;height:20px;"> </div>

    <label for="Vpass" style="display:block;margin-bottom:5px;">Verify Password:</label><input type="password" name="Vpass" id="Vpass" value="" maxlength="" style="width:80px;"><div style="clear:left;height:20px;"> </div>

    <label for="Email" style="display:block;margin-bottom:5px;">Email Address:</label><input type="text" name="Email" id="Email" value="" maxlength="" style="width:80px;"><div style="clear:left;height:20px;"> </div>


    </td>
    <tr>
    <td align="right">
    <!-- YOU CAN MODIFY THE TEXT WITHIN VALUE="" TO MODIFY YOUR BUTTON TEXT-->
    <input type="submit" value=" Submit "> <input type="reset" value=" Reset ">
    </td>
    </tr>
    </table>
    </form>
    <!--webbot bot="HTMLMarkup" endspan -->

    How do i make it, so if "password" and "Vpass" aren't the same thing, it does this code:
    <div id="dropinboxv2cover">
    <div id="dropinboxv2">

    Sorry, your passwords do not match.<br>
    <p align="right"><a href="#" onClick="dismissboxv2();return false">Close It</a></p>

    </div>
    </div>
    Last edited by theplace4fun; 05-01-2007 at 11:10 AM. Reason: Making the code stand out

  2. #2
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    THE FORM
    Code:
    <form name="signup" method="post" onSubmit="verifyIt(this)" onReset="javascript:confirm(Reset The Form?)">
    	<fieldset>
    		<legend>Sign Up</legend>
    		<p>
    			<label for="username">Preferred Username:</label>
    			<input type="text" name="username" id="username" value="" />
    		</p>
    		<p>
    			<label for="password">Preffered Password:</label>
    			<input type="password" name="password" id="password" value="" />
    		</p>
    		<p>
    			<label for="Vpass">Verify Password:</label>
    			<input type="password" name="Vpass" id="Vpass" value="" />
    		</p>
    		<p>
    			<label for="Email">Email Address:</label>
    			<input type="text" name="Email" id="Email" value="" />
    		</p>
    		<input type="submit" value="Submit" />
    		<input type="reset" value="Clear Form" />
    	</fieldset>
    </form>

    MAKING IT LOOK GOOD
    Code:
    <style type="text/css">
    <!--
    p label {
    	float: left; 
    	clear: left;
    }
    p input {
    	float: right;
    	clear: right;
    }
    // -->
    </style>

    Function to see if they are the the same, alert user if they aren't and return to the "password" field
    Code:
    <script type="text/javascript">
    // <![CDATA[
    function verifyIt() {
    	form = document.signup;
    	if(form.password.value !== form.Vpass.value) {
    		alert("Passwords do not match, please check them")
    		form.password.focus();
    	}
    }
    // ]]>
    </script>

  3. #3
    Join Date
    May 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Why isn't it workiong now?

    btw thanks boogyman
    <!--webbot bot="HTMLMarkup" startspan --><form method="post" enctype="multipart/form-data" action="http://pub12.bravenet.com/emailfwd/senddata.php" onSubmit="verifyIt(this)" onReset="javascript:confirm(Reset The Form?)">
    <input type="hidden" name="usernum" value="948392434">
    <input type="hidden" name="cpv" value="2">
    <!-- DO NOT CHANGE OR REMOVE THE 3 TAGS ABOVE THIS COMMENT-->

    <table border="0" cellpadding="0" cellspacing="0" align="center">
    <tr>

    </tr>
    <tr>
    <legend>Sign Up</legend>
    <p>
    <label for="username">Preferred Username:</label>
    <input type="text" class="formbutton2" name="username" id="username" value="" />
    </p>
    <p>
    <label for="password">Preffered Password:</label>
    <input type="password" class="formbutton2" name="password" id="password" value="" />
    </p>
    <p>
    <label for="Vpass">Verify Password:</label>
    <input type="password" class="formbutton2" name="Vpass" id="Vpass" value="" />
    </p>
    <p>
    <label for="Email">Email Address:</label>
    <input type="text" class="formbutton2" name="Email" id="Email" value="" />
    </p>


    </form>
    <tr>
    <td align="right">
    <!-- YOU CAN MODIFY THE TEXT WITHIN VALUE="" TO MODIFY YOUR BUTTON TEXT-->
    <p align="center"><input type="submit" value=" Submit " class="formbutton" > <br><br><input type="reset" value=" Reset " class="formbutton"></p>


    </td>
    </tr>
    </table>
    </form>
    <!--webbot bot="HTMLMarkup" endspan -->
    Forget about class="form" because thats just to make it look better. But now, when i click submit, absolutly nothing happens.

  4. #4
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    You may want to make sure that you are not getting an error in the javascript function "verifyIt". If you could post a link to your problem page, that would help us to solve this problem a lot quicker.

    Sorry for the delayed response, but hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •