ram
ram

Reputation: 1121

Code Igniter- forms

I have a view. In this view

<form id="validate'>
some fields are here.
</form>
<form>
</form>
<input type="Submit" value ="Submit" >

Now submit button will not work since it is in below and I want form id="validate" to get posted.

Since I have to do some JS validation on form id="validate" this will also not work.

My question here is how to post the form and validate the form. Let em know, I f I am not clear here.

Upvotes: 0

Views: 77

Answers (1)

Muhammad Raheel
Muhammad Raheel

Reputation: 19882

It is easy with JQuery if you are using it

<form id="validate'>
    some fields are here.
</form>

var validation  =   $('#validate').validate();

if validation is successfull

$('#validate').submit();

else

//do something else 

Upvotes: 1

Related Questions