Thanks, but how to define rules for 1.phone, 2.state, 3.url 4.email? I believe it has built-in rules that I don’t need to define one myself. please help.
Ok, forget about the second I’d go with first one as is more flexible, but please help how can I have this blue/red icons when validated like the fom below this page: http://jqueryvalidation.org/number-method
I appreciate your help.
I did create a test.php script to query database with $_POST[‘email’] (I tried with $_GET too) and if an email exists it echoes:
{“email”:false}
and in my page I have this rule:
email: {
required: true,
email: true,
minlength: 6,
remote: “test.php”,
},
I tested my script with a post form directly to my script and it works fine, but this rule, is not working, what wrong I did?
Ok, please just help with this remote thing, I described how i did it and is not working, and my another thread about states as “required” of drop down or text field depends on which radio is chosen?
Thanks a lot in advance.
You have to be more precise than “remote thing” and “I described how i did it”
If you make people have to work to help you, then the chances of getting help are considerably lessened.
So again, please:
a) repeat your question
b) provide the code you have
c) state what about your code is not working
As described on their documentation about remote method, i created a php script that fetch $_POST[‘mail’] then query the database to see if posted email exists or not, if exists it echoes this json
{“mail”:false}
Then on my form i did set a rule like the one above, my script is test.php so i set
remote : “test.php”
But it doesn’t work. If exists it doedn’t show an error message. I tested my script with a form directly posted to my script and it works fine so what wrong I did in my rule i pasted completely above? Should be get instead of post? Or my json format is wrong or what?
Thanks a lot. solved. I noticed that form page and script should be in the same folder as "remote: " does not accept path like “includes/json.php”…
If you help for my another question in another thread about drop-down and text field requirment based on which radio is chosen, no more question I’ll have.
If you use Chrome to debug this, you can open the network tab of the dev tools and inspect what is going on under the hood.
In the attached screenshot you can see the final request was to “j/includes/json.php” and it completed successfully with a status code of 200.
As a happy bonus you can also see which parameters the validation script passed to the PHP script.