Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- $(function() {
- $( "#fecha" ).datepicker({
- changeMonth: true,
- changeYear: true,
- yearRange: '1950:2010'
- });
- });
- function list_load(){
- $('#contactos').load('user-list.php',
- function(data){$(this).slideDown('fast');}
- );
- }
- function validateForm()
- {
- //$("#prod_name_error").empty().hide();
- //$("#prod_quantity_error").empty().hide();
- var nombre = $("#nombre").val();
- var apellido = $("#apellido").val();
- var errors = 0;
- if (nombre == null || nombre == '')
- {
- $("#error").show().append("Contact Name is required");
- errors++;
- }
- if (apellido == null || apellido == '')
- {
- $("#error").show().append("Lastname is required");
- errors++;
- }
- if (errors > 0)
- {
- alert ("Errors were found on the form");
- return false;
- }
- }
- jQuery(document).ready(function(){
- $('#form_user').hide();
- $('#editar').hide();
- $('#eliminar').hide();
- $('#agregar').click(function(event) {
- event.preventDefault();
- $('#form_user').show();
- });
- $('#user_form_add').bind('click',function (){
- $.post("user-add.php", $('#form_user').serialize() ,
- function (data){
- list_load();
- }
- );
- });
- $('#contactos').load('user-list.php',
- function(data){
- $(this).slideDown('fast');
- //$("#user_list_table").tablesorter();
- }
- );
- $('#form_user').ajaxForm({
- target: '#content',
- beforeSubmit: validateForm
- });
- });
- </script>
Add Comment
Please, Sign In to add comment