Welcome Guest, Not a member yet? Register   Sign In
codeigniter form validation and jquery form validation problem
#2

[eluser]simshaun[/eluser]
As far as my HTML knowledge goes, you can't nest a form within a form.

Code:
<?php echo form_open('c_f_propreg1_username_v1'); ?>

<form method="POST" name="f_propreg1_username_v1" id="f_propreg1_username_v1">

As to your javascript, why use 2 document.ready's in the same spot?

Optimized:
Code:
// JavaScript Document
$(document).ready(function() {
$('#title').focus();

$('#f_propreg1_username_v1').validate({
rules: {
     email: {
        required: true,
        email: true
        },
        username: {
         required: true,
        rangelength:[6,12]
        },
        pwd: {
        required: true,
        rangelength:[6,12]
        },
         terms: {
        required: true
        },
        conf_pwd: {equalTo:'#pwd'},
         spam: "required"
         }, // end rules
        messages: {
      email: {
         required: "This field is Required.",
         email: "This is not a valid email address."
       },
        username: {
        required: "This field is Required.",
        rangelength: "Username must be between 6 and 12 characters long."
        },
       pwd: {
        required: "This field is Required.",
        rangelength: "Password must be between 6 and 12 characters long."
        },
        conf_pwd: {
        equalTo: "The two passwords do not match."
        },
        terms: {
        required: "Please accept our Terms and Conditions"
        }
      } //end messages
  }); // end validate
  }); //end ready

The issue makes it sound like the form submit is not being stopped by the jQuery validation.
If it was working, then the JavaScript would be ran without a page reload... CodeIgniter should not even see the form post until jQuery validation passes.

I believe you have an error in your logic inside your view.
You might want to post the full code if you want us to debug it.


Messages In This Thread
codeigniter form validation and jquery form validation problem - by El Forum - 11-25-2008, 09:16 AM



Theme © iAndrew 2016 - Forum software by © MyBB