Warning when error on page

jrthor2 05 Feb, 2011
When I submit the following page, and leave one of the required fields blank, I get the below error, right after the red box that says "Please fix the below errors":

Warning: preg_replace() [function.preg-replace]: Unknown modifier 'T' in /home6/zluthorg/public_html/components/com_chronocontact/libraries/includes/JSrepublish.php on line 113

How can I fix this? I think this has to do with the Date/Time select box I have? I am dynamically populating this box. My other question along with this, is that if I have an error on the page, every other field on the form keeps the value the user entered/selected, but the Date/Time select box does not. Any ideas how to fix this as well? Below is the code for my select box:


<p>
    <label for="date_time" class="left"><span class="required">*</span>Date/Time:</label>
    <select name="date_time" id="date_time" title="Please select a Date/Time" tabindex="9" size="1">
       <option value="">Choose Date/Time</option>
        <?php
        $db =& JFactory::getDBO();
        $query = "
          SELECT id, event_date_time, DATE_FORMAT( event_date_time, '%M %d, %Y' ) AS date, TIME_FORMAT( event_date_time, '%h:%i %p' ) AS time
FROM jos_event_schedules WHERE event_date_time NOT IN (SELECT date_time FROM jos_chronoforms_photo_directory) ORDER BY date ASC , time ASC";
        $db->setQuery($query);
        $rows = $db->loadObjectList();   
    
    foreach ($rows as $row) {
         echo "<option value='".$row->event_date_time."'>".$row->date." ". $row->time."</option>\r\n";    
    }
        ?>
    </select>
 <?
        if ($errCond = $session->get('err_date_time', false, md5('chronoerror'))) {
          echo '<br /><div class="error">' . $errCond . '</div>';
        }
        $session->clear('err_date_time', md5('chronoerror'));
    ?>
</p>

Here's a link to another post, that actually shows the error on the screen: http://www.chronoengine.com/forums.html?cont=posts&f=2&t=20856
Thanks.
GreyHead 06 Feb, 2011
Hi jrthor2,

I think that the error is being triggered by the / in the select tag title attribute. Please try switching Date/Time to Date and Time to see if that fixes it.

Bob
jrthor2 06 Feb, 2011
Thanks, I removed the / in the title and in the validation code, and it seems to be working.

Thanks again!
This topic is locked and no more replies can be posted.