Welcome Guest, Not a member yet? Register   Sign In
Form Validation / Pre-populated input fields
#8

[eluser]Maglok[/eluser]
You can just leave the third parameter empty to not check on anything with that field. xss_cleaning because you need to do something is kinda odd.

There is another issue with this though, at least in my opinion. Let's say it's an edit form, you grab data from a database, display it, check new values and update the database.

You'd determine which value the page should show like this (in bambooinvoice and other CI apps at least):
Code:
set_value('something')? $data['something']=set_value('something'):$data['something'] = $row->something;
The set_value can't see if you want a field to be empty or not though. This leaves room for the following scenario: Someone edits an exsisting thing, then empties a required field and a non-required field. It will then reload the page stating the required field is required AND it will repopulate both fields. Even if the non-required field is meant to stay empty.


Messages In This Thread
Form Validation / Pre-populated input fields - by El Forum - 08-11-2009, 12:50 PM
Form Validation / Pre-populated input fields - by El Forum - 08-11-2009, 02:16 PM
Form Validation / Pre-populated input fields - by El Forum - 08-11-2009, 02:34 PM
Form Validation / Pre-populated input fields - by El Forum - 08-11-2009, 03:04 PM
Form Validation / Pre-populated input fields - by El Forum - 08-11-2009, 03:22 PM
Form Validation / Pre-populated input fields - by El Forum - 08-11-2009, 05:10 PM
Form Validation / Pre-populated input fields - by El Forum - 08-11-2009, 06:30 PM
Form Validation / Pre-populated input fields - by El Forum - 08-12-2009, 03:03 AM
Form Validation / Pre-populated input fields - by El Forum - 08-16-2009, 05:27 AM
Form Validation / Pre-populated input fields - by El Forum - 08-22-2009, 09:38 PM



Theme © iAndrew 2016 - Forum software by © MyBB