Need more validation field, how to escape ' in db

Shows some Tutorials

Need more validation field, how to escape ' in db

Postby kleeflang on Fri Mar 28, 2008 7:37 pm

Hello all,

I have two questions on validation.
1. I use a lot of fields, now there isn't enough room in the admin to fill them al in the not-blank validation. Is there a way to expand this?
2. If a user input has a ' the form doesn't get saved to the db. The e-mail is fine though (\'), is there a way to filter out the ' before it's send to the db?

Thanks,

Krijn
kleeflang
Fresh Boarder
 
Posts: 6
Joined: Fri Mar 28, 2008 10:16 am

Re:Need more validation field, how to escape ' in

Postby GreyHead on Sat Mar 29, 2008 3:49 am

Hi Krijn,

1) You need to look for a block of code like this in admin.chronocontact.html.php:
Code: Select all
<tr>
  <td><?php echo mosToolTip( REQUIRED_TT ); ?></td>
  <td><strong>1 - <?php echo REQUIRED; ?></strong> </td>
  <td></td>
  <td>
    <input type="text" name="params[val_required]" id="params[val_required]" class="inputbox" size="50" maxlength="500" value="<?php echo $paramsvalues->val_required; ?>">
  </td>
</tr>
You can change the maxlength value to something bigger (looks as though I've already edited this one from CF for Joomal 1.0.x

2) in the Autogenerated tab replace $_POST['fieldname'] with addslashes($_POST['fieldname']) I think that should do it.

Bob<br><br>Post edited by: GreyHead, at: 2008/03/29 00:02
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3966
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany


Return to ChronoForms How To

Who is online

Users browsing this forum: No registered users and 4 guests