CodeIgniter Forums

Full Version: Form Validation - add input field on error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum


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 user enters DNS "" and submits the form - the validation should return error message with additional input field for ip address of that "". This additional field should also be run through validation (for valid_ip rule).

Could You give me some hints?

Thank You.

El Forum

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.