Board Logo

multiple validation
Stijn - 7/27/2007 at 01:08 AM

Hi, I searched hours to solve this problem but can't find it...
The multiple validation just won't work...;

Code:

<table cellpadding="0" cellspacing="0">
<form action="" method="post" name="login" id="loginblabla" onsubmit='return v.exec()'>
<tr><td width="80" id="t_username">Email address</td>
<td width="15"></td><td><input type="text" name="username" class="textfield"></td></tr>
<tr><td id="t_password">Password</td><td></td>
<td><input type="password" name="password" class="textfield"></td></tr>
</table>
<table cellpadding="0" cellspacing="0">
<tr><td width="91"></td><td><INPUT TYPE="checkbox" NAME="cookie" class="checkbox"> remember me</td></tr>
</table>
<input type="hidden" name="login" value="yes">
<table cellpadding="0" cellspacing="0">
<tr><td width="80"></td><td width="15"></td><td><input type="submit" value="| check information" name="login" class="button"></td></tr>
</form>

<script>
// form fields description structure
var a_fields = {
'username' : {'l':'Email address','r':true,'f':'email','t':'t_username'},
'password' : {'l':'Password','r':true,'f':'alphanum','t':'t_password'}
},

o_config = {
'to_disable' : ['Submit'],
'alert' : 1
}
// validator constructor call
var v = new validator('login', a_fields, o_config);
</script>
</table>

<table cellpadding="0" cellspacing="0">
<form action="" method="post" name="register" id="register" onsubmit='return v.exec()'>
<tr><td width="80" id="t_firstname">First name</td>
<td width="15"></td><td><input type="text" name="firstname" class="textfield"></td></tr>
<tr><td width="80" id="t_name">Surname</td>
<td width="15"></td><td><input type="text" name="name" class="textfield"></td></tr>
<tr><td width="80" id="t_email">Email address</td>
<td width="15"></td><td><input type="text" name="email" class="textfield"></td></tr>
<tr><td width="80" id="t_company">Company</td>
<td width="15"></td><td><input type="text" name="company" class="textfield"></td></tr>
</table>
<input type="hidden" name="register" value="yes">
<table cellpadding="0" cellspacing="0">
<tr><td width="80"></td><td width="15"></td><td><input type="submit" value="| complete form" name="Submit" class="button"></td></tr>
</form>
<script>
// form fields description structure
var a_fields = {
'firstname' : {'l':'First name','r':true,'f':'alpha','t':'t_firstname'},
'name' : {'l':'Surname','r':true,'f':'alpha','t':'t_name'},
'email' : {'l':'Email address','r':true,'f':'email','t':'t_email'},
'company' : {'l':'Company','r':true,'f':'alphanum','t':'t_company'}
},

o_config = {
'to_disable' : ['Submit'],
'alert' : 1
}
// validator constructor call
var v = new validator('register', a_fields, o_config);
</script>
</table>


Any ideas? Of course I'm loading the script, putting the whole page here would be a mess...


Stijn - 7/27/2007 at 04:06 AM

found it, var b = new validator('register', a_fields, o_config);

sorry!


Softcomplex: http://www.softcomplex.com/
Back to forum: http://www.softcomplex.com/forum/