Validar formulario MODAL

Enviada por Anderson Miranda Barrozo 
Anderson Miranda Barrozo
Validar formulario MODAL
18 de October de 2012 às 07:58PM
Boa noite,
To usando o shadowbox para criar um formulario de contato MODAL. Não estou conseguindo validar os campos. Alguem poderia me ajudar ?


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>My Shadows</title>
<script type="text/javascript" src="shadowbox_js/jquery.min.js"></script>
<script type="text/javascript" src="shadowbox_js/shadowbox.js"></script>
<script src="jquery-latest.js"></script>
<script type="text/javascript" src="jquery.validate.js"></script>

<link rel="stylesheet" type="text/css" href="shadowbox_js/shadowbox.css">
<link rel="stylesheet" type="text/css" href="estilo.css" />

<style type="text/css">
* { font-family: Verdana; font-size: 96%; }
label { width: 10em; float: left; }
label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
p { clear: both; }
.submit { margin-left: 12em; }
em { font-weight: bold; padding-right: 1em; vertical-align: top; }

</style>

<script>
$(document).ready(function(){
$("#commentForm").validate();
});
</script>

<script type="text/javascript">
Shadowbox.init({
language: 'pt',
handleOversize: 'resize',
modal: true,
overlayOpacity: 0.7,
players: ['img', 'html', 'iframe', 'qt', 'wmp', 'swf', 'flv'],
});
</script>

</head>

<body>

<a href="#form" rel="Shadowbox;width=600;height=600px"> Abrir Novo</a>

<div id="form">

<form class="cmxform" id="commentForm" method="post" action="">
<fieldset>
<legend>A simple comment form with submit validation and default messages</legend>
<p>
<label for="cname">Name</label>
<em>*</em><input id="cname" name="name" size="25" class="required" minlength="2" />
</p>
<p>
<label for="cemail">E-Mail</label>
<em>*</em><input id="cemail" name="email" size="25" class="required email" />
</p>
<p>
<label for="curl">URL</label>
<em> </em><input id="curl" name="url" size="25" class="url" value="" />
</p>
<p>
<label for="ccomment">Your comment</label>
<em>*</em><textarea id="ccomment" name="comment" cols="22" class="required"></textarea>
</p>
<p>
<input class="submit" type="submit" value="Enviar"/>
</p>
</fieldset>
</form>


</div>


</body>
</html>
Você precisa estar logado no PHPBrasil.com para poder enviar mensagens para os nossos fóruns.

Faça o login aqui.