Jump to content

Setting maximum length to description text area


dc_jt

Recommended Posts

I have a validation function like this:

[code]private function ValidateData($aPostData)
{
//If normal listing
if ($aPostData['iTypeId'] == 1){
//check all fields
if (trim($aPostData['name']) == "") return false;
if (trim($aPostData['address']) == "") return false;
if (trim($aPostData['postcode']) == "") return false;
if (trim($aPostData['telephone_number']) == "") return false;
if (trim($aPostData['fax']) == "") return false;
if (trim($aPostData['email']) == "") return false;
if (trim($aPostData['description']) == "") return false;
return true;
//All larger Ads
}else{

if (trim($aPostData['name']) == "") return false;
return true;
}
}//end function[/code]

I want to add something so that the user cant enter more than 120 characters in the description box.

How could I add this?

Thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.