Changeset 99 for trunk/app/views/newsletters
- Timestamp:
- 09/12/07 15:14:48 (15 months ago)
- Files:
-
- 1 modified
-
trunk/app/views/newsletters/subscribe.thtml (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/views/newsletters/subscribe.thtml
r97 r99 3 3 <p>Keep informed about our activities</p> 4 4 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 9 if ( !$othAuth->sessionValid() ) 10 { 11 echo "<p>You must be logged to subscribe to newsletter</p>"; 12 } 13 14 echo $ajax->div('updater'); 15 16 echo $ajax->form(null, 'post'); 17 ?> 6 18 <fieldset> 7 19 <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); ?> 10 30 <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 ?> 12 38 </fieldset> 13 39 </form> … … 16 42 17 43 <?php 18 echo $html->link('View pass newsletters', '/newsletters/all'); 44 echo $ajax->divEnd('updater'); 45 echo $html->link('View pass newsletters', '/newsletters/all'); 19 46 ?> 47 <script type="text/javascript"> 48 49 function 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>
