Show
Ignore:
Timestamp:
09/13/07 14:13:04 (15 months ago)
Author:
aarkerio
Message:

Update

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/views/messages/contact.thtml

    r1 r103  
     1<?php echo $javascript->link('fckeditor/fckeditor'); ?> 
    12<div id="charging" style="display:none;"><?php echo $html->image('static/loading.gif', array("alt"=>"Loading")); ?></div> 
    23 
    3 <div id="updater" style="margin:6px;padding:7px;"></div> 
    4 <div class="spaced" id="form_message"> 
    5 <?php echo $html->formTag(null, 'post', array('onsubmit'=>'return false')); ?> 
     4<div id="updater" style="margin:6px;padding:7px;"> 
     5 
     6<?php echo $ajax->form(null, 'post'); ?> 
    67 
    78<fieldset> 
    8   <legend>Message to Webmaster:</legend> 
    9       
    10      <?php echo $form->labelTag('Message/username', 'Login:' );?><br /> 
    11      <?php echo $html->input('Message/username', array("size" => 6, "maxlength" => 10, "onBlur"=>"this.value=this.value.toLowerCase()")); ?><span class="small">At least 5 characters, only lowercase. No spaces.</span> 
     9  <legend>Message to #YOUR SCHOOL NAME HERE#:</legend> 
     10     <p> 
     11        <?php  
     12          echo $form->labelTag( 'Message/title', 'Title:' ) . '<br />'; 
     13          echo $html->selectTag('Message/title', array("Mr." => "Mr.", "Miss" => "Miss"));  
     14        ?> 
     15     <br /> 
     16     <?php echo $form->labelTag('Message/name', 'Name:' );?><br /> 
     17     <?php echo $html->input('Message/name', array("size" => 30, "maxlength" => 40)); ?> 
    1218     <br /><br /> 
    1319     <?php echo $form->labelTag('Message/email', 'Email:' );?><br /> 
    1420     <?php echo $html->input('Message/email', array("size" => 20, "maxlength" => 45)); ?> 
    15      <br /><br /> 
    16      <?php echo $form->labelTag('Message/name', 'First and last name:' );?><br/> 
    17      <?php echo $html->input('Message/name', array("size" => 25, "maxlength" => 50)); ?> 
    18      <br /><br /> 
    19         <p><?php echo $form->labelTag( 'Message/title', 'Title' );?><br /> 
    20      <?php echo $html->input('Message/title', array("size" => 40, "maxlength" => 80)); ?> 
    21          <?php echo $html->tagErrorMsg('Message/title', 'Title is required.'); ?> 
    22          </p> 
    23           
    24          <p><?php echo $form->labelTag( 'Message/body', 'Body:' );?><br /> 
    25          <?php echo $html->textarea('Message/body', array("class"=>"formas", "cols"=>50, "rows"=>35)) ?> 
    26          <?php echo $fck->load('Message/body', 'Basic', 400); ?> 
    27          <?php echo $html->tagErrorMsg('Message/body', 'Body is required.'); ?> 
    28          <br /> 
    29          </p> 
     21     <br />      
     22     <p> 
     23        <?php echo $form->labelTag( 'Message/body', 'Body:' );?><br /> 
     24    <?php echo $html->textarea('Message/body', array("cols"=>15, "rows"=>5)); ?> 
     25    <?php echo $fck->load('Message/body', 'Basic', 480, 220); ?> 
     26    <?php echo $html->tagErrorMsg('Message/body', 'Body is required.'); ?> 
     27    <br /> 
     28      </p> 
    3029       
    31   <?php echo $ajax->submit('Send', array("url" => "/messages/insert/",  
    32                                          "update"=>"updater", 
    33                                          "loading" => "Element.show('charging');Element.hide('updater')", 
     30  <?php echo $ajax->submit('Send', array("url"      => "/messages/insert/",  
     31                                         "update"   =>"updater", 
     32                                         "before"   => "return chkForm();MyFCKObject.UpdateEditorFormValue()",  
     33                                         "loading"  => "Element.show('charging');Element.hide('updater')", 
    3434                                         "complete" => "Element.hide('charging');Effect.Appear('updater')" 
    35         )); ?> 
     35        ));  
     36echo $fck->fckAjax(); // Fckeditor hack to work with ajax 
     37?> 
    3638</fieldset> 
    3739</form> 
    3840</div> 
     41<script type="text/javascript"> 
     42function chkForm() 
     43{  
     44  var name  = document.getElementById("MessageName"); 
     45  var email = document.getElementById("MessageEmail"); 
     46 
     47  if (name.value.length < 3) 
     48  { 
     49    alert('The name must have five characters at least'); 
     50    name.focus(); 
     51    return false; 
     52  } 
     53   
     54  //check email 
     55  var atpos  = email.value.indexOf("@");    //indexOf find something in your JavaScript string 
     56  var dotpos = email.value.indexOf("."); 
     57   
     58  //alert('at: ' + atpos); 
     59   
     60  if ( atpos < 1 || dotpos < 1 || email.value.length < 5)  
     61  { 
     62    alert('Mmmm, this email ' + email.value + ' does not look as a valid email'); 
     63    email.focus(); 
     64    return false; 
     65  } 
     66  return true; 
     67} 
     68</script>