Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.63 KB | None | 0 0
  1. <html> 
  2.     <head>
  3.     <style type="text/css">
  4.         table{
  5.             color: #ffffff;
  6.         }
  7.     </style>
  8.     <script type="text/javascript">
  9.         function validate(){
  10.             var filter = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
  11.             if(document.text.message.value == "" || document.text.p1.value == "" || document.text.p2.value == "" || document.text.p3.value == "" || document.text.email.value == ""){
  12.                 alert("Error: All fields must be filled out");
  13.                 return false;
  14.             } else {
  15.                 if(filter.test(document.getElementById('email').value) == false){
  16.                     alert("Error: Invalid email address");
  17.                     return false;
  18.                 } else {
  19.                     return true;
  20.                 }
  21.             }
  22.         }
  23.     </script>
  24.     <script type="text/javascript">
  25.         function move(field,nextElem) {
  26.             if(field.value.length >= field.maxLength){
  27.                 document.getElementById(nextElem).focus();
  28.             }
  29.         }
  30.     </script>
  31.     </head>
  32.     <div align='center'>
  33.     <body onLoad="document.text.p1.focus();" bgcolor='#00000'>
  34.         <font color="white">
  35.             <p><H3>Send Free Text Messages!</H3></p>
  36.             <form name='text' action='text.php' method='POST' onSubmit="return validate();">
  37.                 <table>
  38.                     <tr>
  39.                         <td>Number To Text: </td><td><input type='text' name='p1' id='p1' size='2' maxlength='3' onKeyUp="move(this,'p2');">
  40.                                                      <input type='text' name='p2' id='p2' size='2' maxlength='3' onKeyUp="move(this,'p3');">
  41.                                                      <input type='text' name='p3' id='p3' size='3' maxlength='4' onKeyUp="move(this,'email');">
  42.                                                 </td>
  43.                     </tr>
  44.                     <tr>
  45.                         <td>Your Email Address: </td><td><input type='text' name='email' id='email'></td>
  46.                     </tr>
  47.                     <tr>
  48.                         <td>Message: </td><td><textarea name='message'></textarea></td>
  49.                     </tr>
  50.                     <tr>
  51.                         <td>Carrier: </td><td>
  52.                         <select name='carrier'>
  53.                             <option value='verizon'>Verizon</option>
  54.                             <option value='att'>ATT</option>
  55.                             <option value='tmobile'>Tmobile</option>
  56.                             <option value='metropcs'>Metro PCS</option>
  57.                             <option value='virgin'>Virgin Mobile</option>
  58.                             <option value='vmcanada'>Virgin Mobile Canada</option>
  59.                         </select>
  60.                         </td>
  61.                     </tr>
  62.                     <tr>
  63.                         <td><input type='submit' value='Send'></td><td><input type='reset' value='Clear'></td>
  64.                     </tr>
  65.                 </table>
  66.             </form>
  67.             <p><?if($_GET['blank'] == 'true') { ?> Error: Please fill in all fields <? } ?>
  68.                <?if($_GET['send'] == 'true') { ?> Message Sent! You should recieve a confirmation email shortly. <? } ?>
  69.                <?if($_GET['error'] == 'true') { ?> Error: Message could not be sent <? } ?>
  70.                <?if($_GET['inemail'] == 'true') { ?> Error: Invalid Email Address <? } ?>
  71.             </p>
  72.         </font>
  73.     </body>
  74.     </div>
  75. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement