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

Share

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/views/newsletters/subscribe.thtml

    r97 r99  
    33<p>Keep informed about our activities</p> 
    44 
    5 <?php echo $html->formTag('/newsletters/add', 'post', array('onsubmit'=>'return false')); ?> 
     5<div id="charging" style="display:none;"><?php echo $html->image('static/loading.gif', array("alt"=>"Loading")); ?></div> 
     6 
     7<?php  
     8 
     9if ( !$othAuth->sessionValid() ) 
     10{ 
     11  echo "<p>You must be logged to subscribe to newsletter</p>"; 
     12} 
     13 
     14echo $ajax->div('updater'); 
     15 
     16echo $ajax->form(null, 'post');  
     17?> 
    618<fieldset> 
    719  <legend>Subscribe:</legend> 
    8      <?php echo $form->labelTag('Newsletter/email', 'Email:' );?><br /> 
    9      <?php echo $html->input('Newsletter/email', array("size" => 25, "maxlength" => 50)); ?> 
     20     <?php echo $form->labelTag('Subscribers/email', 'Email:'); ?><br /> 
     21     <?php  
     22     $options =  array("size"=>25, "maxlength"=>50); 
     23 
     24     if ( !$othAuth->sessionValid() ) 
     25     { 
     26        $options["readonly"]="readonly"; 
     27     } 
     28      
     29     echo $html->input('Subscribers/email', $options); ?> 
    1030     <br /><br /> 
    11      <?php echo $html->submit('Send'); ?> 
     31     <?php  
     32          echo $ajax->submit('Send', array("url" => "/subscribers/add/", 
     33                              "update"=>"updater", 
     34                      "loading" => "Element.show('charging');Element.hide('updater')", 
     35                                  "complete" => "Element.hide('charging');Effect.Appear('updater')" 
     36                         )); 
     37?> 
    1238</fieldset> 
    1339</form> 
     
    1642 
    1743<?php 
    18       echo $html->link('View pass newsletters', '/newsletters/all'); 
     44   echo $ajax->divEnd('updater'); 
     45   echo $html->link('View pass newsletters', '/newsletters/all'); 
    1946?> 
     47<script type="text/javascript"> 
     48 
     49function chkField() 
     50{  
     51  var email  = document.getElementById("SubscribersEmail"); 
     52  alert('I am here'); 
     53   
     54  if (email.value.length < 3) 
     55  { 
     56    alert('The name must have three letters at least'); 
     57    email.focus(); 
     58    return false; 
     59  } 
     60 
     61  return true; 
     62} 
     63</script>