[thelist] PHP_SELF / Contact Form

Kevin Timmins kipper_timmins at live.co.uk
Wed Aug 4 13:46:55 CDT 2010


>
> It works when the message is in one line. However when multiple line of 
> message entered it does not.
>
> Any idea how to add the support for multiple line into the Regex?
>
>


Ahh this sounds like a new line issue to me from what I can glean.
Could you let us know what isn't working? is it the text area not showing, 
information not getting through the validation?
You might need to replace \n\r with your own newline characters such as 
[newline] or something like that with a string replacement.
Sorry I can't be more specific,
Hope this helps a bit
Kevin


>
>
>> I am using the following for text area :
>>
>> if(!preg_match('/^([a-zA-Z0-9_\'\s]+)$/', $message)){
>> $errMsg7 .= "Invalid Entry, Please enter only words";
>> $valid = false;
>> }
>>
>> and:
>>
>> if(strlen($message) > 200 ){
>>
>> // sets max amount of characters in comments area (edit as nesesary)
>>
>> $message=substr($message, 0, 200).'...';
>> $error .="We are sorry for inconvenience. Your message should not exceed 
>> 200 characters.<br />";
>> $valid = false;
>> }
>>
>> and for the errors to show:
>>
>>
>> <?php if(isset($errMsg6) && !empty($errMsg6)) {
>> echo '<p class="message" >' . $errMsg6 . '</p>';
>> }?>
>>
>> <textarea name="message" id="message" rows="15" cols="50" value="" ><?php 
>> echo($message)?></textarea>
>>
>> But it does not work.  Any idea would be appreciated.
>
>
> -- 
>
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
> 


More information about the thelist mailing list