Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 72601

Re: jquery is overriding the JS validation

$
0
0

Hi Nancy,


Agreed, however right now I would like to know how to make this work for my current project


Here is the code from here ...


http://www.javascript-coder.com/html-form/javascript-form-validation.phtml

Now I just need to figure out how to = add post code AFTER the form has successfully validated.

 

my laymen version...

 

1 - test here

2 - if success....

alert ("success");

then add more code like... $.post('https://mysite.com/test.php', { password: pass, ...... etc.

3 - if fail - then

alert ("fail");

Any idea how to set this up with this code from this site?

 

 

<!DOCTYPE html>

<html>

<head>

<title>test</title>

<style type="text/css" xml:space="preserve">

BODY, P,TD{ font-family: Arial,Verdana,Helvetica, sans-serif; font-size: 10pt }

A{font-family: Arial,Verdana,Helvetica, sans-serif;}

B { font-family : Arial, Helvetica, sans-serif; font-size : 12px; font-weight : bold;}

.error_strings{ font-family:Verdana; font-size:14px; color:#F00; }

</style>

<script src="gen_validatorv4.js" type="text/javascript" >

</script>

</head>

 

<body>

<form action="" method="POST" id="nowform">

<div class="box1 center1">

<p>enter PASSWORD<br>

<div id='nowform_pass_errorloc' class="error_strings"></div>

<input id="pass" name="pass" type="password" size="15" class="print_data_22" />

</p>

<input type="submit"  />

</form>

<script>

 

alert ("test1");

 

 

var frmvalidator = new Validator("nowform");

frmvalidator.EnableOnPageErrorDisplay();

frmvalidator.EnableMsgsTogether();

frmvalidator.addValidation("pass","req","Please enter your pass");

frmvalidator.addValidation("pass","maxlen=15", "Max length for pass is 15");

 

 

 

alert ("test2");

 

 

//start post code... WHERE DO I PUT THIS POST CODE?

$.post('http://mysite.com/getstuff.php', { ... etc...

 

</script>

</body>

</html>


Viewing all articles
Browse latest Browse all 72601

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>