View Single Post
Old 04-20-2008, 04:01 AM   #2 (permalink)
TlcAndres
The Addict
 
Join Date: Nov 2007
Posts: 264
Thanks: 2
TlcAndres is on a distinguished road
Default

I would use Jooney to send the form across with ease but if you wanted to do it without a framework it would be something like this

Quote:
function validate(){
var name = document.forms[0].txt_username;
var pass = document.forms[0].txt_password;

if(name == ''){
alert('You need to fill out the username form');
return false;
}

if(pass == ''){
alert('Please fill in a password');
return false;
}
}
Quote:
<form method="post" action="domain.com/forms.php" onSubmit="javascript:validate();">
<input type="text" name="txt_username" value=">'><script>alert('xss');</script>">

<input type="text name="txt_password" value=">'><script>alert('xss');</script>">
<input type="submit" name="submit" value="submit">
</form>
then you take your form and do this
__________________
"What everyone seems to forget is that while knowledge certainly is something - it's the implementation of knowledge that brings power" - Andres Galindo.
TlcAndres is offline  
Reply With Quote