It looks like you're new here. If you want to get involved, click one of these buttons!
In vanilla registration form, i have noticed that the validation of input fields is based in the fields of your table.
Now, i don't want the address, post code to be not required. What file do i need to edit? I'm using the register captcha form.
you are going to have a little hard time to check out.
all views are located in
\applications\dashboard\views\entry
x00
Don't PM about development, I'm not currently taking on clients MVP
look at the RegisterCaptcha method
see
$this->UserModel->Validation->ApplyRule('FieldName', 'RuleName');
If you want to know how validation actually works look at
forum/library/core/class.validation.php
forum/library/core/functions.validation.php
You can see the existing rules that you can use and you can add rules like so
Validation->AddRule('RuleName','function:SomeFunction');
you can also do regular expressions e.g.
Validation->AddRule('RuleName','regex:`^[\d]{5}$`');
x00
Don't PM about development, I'm not currently taking on clients MVP
Generally validation follows the schema, so if something is not required in the database, it is not required on the form. You can set the default value to null.
I can't give in depth programming coaching, that is not really reasonable to expect this. I gave you the answer. I suggest you delve a little deeper, or pay someone to do it for you.
Ideally you would avoid editing the core if you can, you can hook the user model if nessisary
x00
Don't PM about development, I'm not currently taking on clients MVP
I read "i don't want the address, post code to be not required" to mean you wanted them to be required.
But in any event first check your schema in the database before editing any code. The only reason why I added the addrule, bit is becuase stuff like post codes are often validated, but not necessarily required.
I didn't really get from the OP what you wanted.
Answers
I have already looked at those files. But i don't see the script there that validates the input field.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Hi, i looked for function register in the class.entrycontroller.php but i couldn't found it.
Here is my form action:
$this->Form->Open(array('Action' => Url('/entry/register'), 'id' => 'Form_User_Register', 'enctype' => 'multipart/form-data'));I'm using the registercaptcha form.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Hi x00, thanks for the response. This is the code in the recaptcha function that i saw:
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •What part should i edit here, so that the address, postcode and other fields of the form will not be required.
Currently it requires all field to be filled in and that is what i saw in my recaptcha function.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Thank you X00, got your point. I just need to change the database settings. Set the fields to null. Thank you so much
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •