Welcome Guest, Not a member yet? Register   Sign In
Form error suggestions
#1

[eluser]sqwk[/eluser]
I implemented a javascript autocomplete that grabs possible values from a database table. Javascript also intercepts the form and submits the ids for the relevant rows instead of the actual value.

The problem starts when javascript is turned off. At the moment the php code only knows how to handle the actual ids. I would like to check whether the submitted value is a number and if not, check if there is a correlating row to replace the value with the id. If there isn't I need to set a custom error message along the lines of 'Did you mean "value"'.

Long story short:
a) How can I find similar rows? (SQL/PHP question)
b) Can I set error messages inside a custom validation function? (CI question)




Theme © iAndrew 2016 - Forum software by © MyBB