Welcome Guest, Not a member yet? Register   Sign In
Validation
#1

[eluser]jasonswett[/eluser]
I've gone through most of the CodeIgniter Form Validation User Guide Page and it worked just fine. But what if you're dealing not with a sign-up form but a form meant to update values in a database?

Here's what the XHTML for one of my fields would look like:
Code:
<tr>
  <th>First Name</th>
  <td>&lt;input type="text" size="40" name="first_name" id="first_name" value="&lt;?= $contact-&gt;first_name ?&gt;" /></td>
</tr>

And here's what the CodeIgniter example uses:
Code:
<h5>Username</h5>
&lt;input type="text" name="username" value="&lt;?=$this-&gt;validation->username;?&gt;" size="50" />

Using "$this->validation->whatever" is fine for when the user submits an incomplete form, then gets redirected back to the same form, but it wouldn't be useful on the initial page load.

Is there a reasonable solution to this problem? It seems like a pretty common need and I'm surprised I haven't been able to find the answer yet.

Thanks,
Jason


Messages In This Thread
Validation - by El Forum - 10-22-2007, 12:04 PM
Validation - by El Forum - 10-22-2007, 01:24 PM
Validation - by El Forum - 10-22-2007, 02:07 PM
Validation - by El Forum - 10-22-2007, 02:21 PM
Validation - by El Forum - 10-22-2007, 03:01 PM
Validation - by El Forum - 10-22-2007, 03:30 PM



Theme © iAndrew 2016 - Forum software by © MyBB