Hola amigos!!... es la primera vez que hago una pregunta en este foro y espero a que por favor, me ayuden.
Bien, tengo un formulario, el cual, al validar los campos, aparece una imagen (logo de check) mientras el campo esté llenado correctamente.
Sino, pues aparece un mensaje de color rojo pidiendome que lo llene.
Yo, ya he conseguido guardar los datos del formulario en mi base de datos, pero, el problema es que no consigo quitar la imagen (logo de check) después de mandar mis datos a process.php, por eso, estoy obligado a darle F5 y eso no quiero.
Quisiera que me ayuden a quitar esa imagen (logo de check).
Aqui les paso el codigo:
index.html
<!DOCTYPE html>
<?php
include("Conexion.php");
$cn = Conectarse();
?>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap jQuery Validate form : twitterbootstrap.org</title>
<meta name="viewport" content="width=device-width">
<link href="style.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="row-fluid">
<div class="span12">
<h1>Twitter Bootstrap jQuery Validate Registration form</h1>
</div>
</div>
<div class="row-fluid">
<div class="span6 offset6">
<div id="maincontent" class="span8">
<form id="registration-form" class="form-horizontal" action="process.php" method="POST">
<h1>Sample Registration form <small>(Fill up the forms to get register)</small></h1>
<br/>
<div class="form-control-group">
<label class="control-label" for="name">Your Name</label>
<div class="controls">
<input type="text" class="input-xlarge" name="name" id="name">
</div>
</div>
<div class="form-control-group">
<label class="control-label" for="name">User Name</label>
<div class="controls">
<input type="text" class="input-xlarge" name="username" id="username">
</div>
</div>
<div class="form-control-group">
<label class="control-label" for="name">Password</label>
<div class="controls">
<input type="password" class="input-xlarge" name="password" id="password">
</div>
</div>
<div class="form-control-group">
<label class="control-label" for="name"> Retype Password</label>
<div class="controls">
<input type="password" class="input-xlarge" name="confirm_password" id="confirm_password">
</div>
</div>
<div class="form-control-group">
<label class="control-label" for="email">Email Address</label>
<div class="controls">
<input type="text" class="input-xlarge" name="email" id="email">
</div>
</div>
<div class="form-control-group">
<label class="control-label" for="message">Your Address</label>
<div class="controls">
<textarea class="input-xlarge" name="address" id="address" rows="3"></textarea>
</div>
</div>
<div class="form-control-group">
<label class="control-label" for="message"> Please agree to our policy</label>
<div class="controls">
<input id="agree" class="checkbox" type="checkbox" name="agree">
</div>
</div>
<div class="form-actions">
<button type="submit" class="btn btn-success btn-large">Register</button>
<button type="reset" class="btn">Cancel</button>
</div>
</form>
</div>
<!-- .span -->
</div>
<!-- .row -->
</div>
<!-- .container -->
<script src="assets/js/jquery-1.7.1.min.js"></script>
<script src="assets/js/jquery.validate.js"></script>
<script src="script.js"></script>
</body>
</html>
-----------------------
script.js
$(document).ready(function(){
$('#registration-form').validate({
rules: {
name: {
required: true,
required: true
},
username: {
minlength: 6,
required: true
},
password: {
required: true,
minlength: 6
},
confirm_password: {
required: true,
minlength: 6,
equalTo: "#password"
},
email: {
required: true,
email: true
},
address: {
minlength: 10,
required: true
},
agree: "required"
},
highlight: function(element) {
$(element).closest('.control-group').removeClass('success').addClass('error');
},
success: function(element) {
element
.text('OK!').addClass('valid')
.closest('.control-group').removeClass('error').addClass('success');
},
submitHandler: function(form){
var dataString = $('#registration-form').serialize();
$.ajax({
type: "POST",
url:"process.php",
data: dataString,
success: function(data){
$('#registration-form')[0].reset();
}
});
}
});
});
// end document.ready
-----------------------
process.php
<?php
include("Conexion.php");
$cn=Conectarse();
$name = strip_tags($_POST['name']);
$email = strip_tags($_POST['username']);
$sug = strip_tags($_POST['address']);
$rsalumnos="insert into boot(nombre,email,mensaje)
values('$name','$email','$sug')";
$insertaralumnos= mysql_query($rsalumnos);
?>