| 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)); ?> |
| 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> |
| 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')", |
| | 41 | <script type="text/javascript"> |
| | 42 | function 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> |