CodeIgniter Forums
Form Validation - add input field on error - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Form Validation - add input field on error (/thread-43426.html)



Form Validation - add input field on error - El Forum - 07-11-2011

[eluser]Unknown[/eluser]
Hi.

I would like to ask You about an idea how to achieve following behavior:
one of the fields in the form is responsible for holding information about DNS server in a particular domain. If the DNS server is in that domain another field for IP address should be added to the form - for example if for domain example.com user enters DNS "ns1.example.com" and submits the form - the validation should return error message with additional input field for ip address of that "ns1.example.com". This additional field should also be run through validation (for valid_ip rule).

Could You give me some hints?

Thank You.


Form Validation - add input field on error - El Forum - 07-11-2011

[eluser]smilie[/eluser]
I would rather go for JS to determine (on blur) that DNS entry belongs to the domain;
if so, with JS 'show' the input field. Upon submit, you have both fields and can check them.

Cheers,
Smilie