Expand|Select|Wrap|Line Numbers
- <script type="text/javascript">
- // we will add our javascript code here
- $(document).ready(function(){
- $("#ajax-contact-form").submit(function(){
- var str = $(this).serialize();
- $.ajax({
- type: "POST",
- url: "contact.php",
- data: str,
- success: function(msg){
- $("#note").ajaxComplete(function(event, request, settings){
- if(msg == 'OK') // Message Sent? Show the 'Thank You' message and hide the form
- {
- result = '<div class="notification_ok"><br><br><br><br><br><blockquote>Thank You!<p>Your message has been sent and we will contact you at our earliest conveniece.<p>Thank you!</blockquote></div>';
- $("#fields").hide();
- }
- else
- {
- result = msg;
- }
- $(this).html(result);
- });
- }
- });
- return false;
- });
- });
- </script>
I have manipulated this script for another DIV, but it's not producing the same results as the first div - even after renaming the DIV ID.
I have a semi-working version of it here for you to see:
http://www.prescriptionpc.com/TEST_n...ection=contact (this one works PERFECT)
http://www.prescriptionpc.com/TEST_n...ml#section=sms (this is one I am having problems with)
The code I have for my "sms" DIV is as follows:
Expand|Select|Wrap|Line Numbers
- <?php
- error_reporting (E_ALL ^ E_NOTICE);
- $post = (!empty($_POST)) ? true : false;
- if($post)
- $from = stripslashes($_POST['from']);
- $to = stripslashes($_POST['to']);
- $carrier = stripslashes($_POST['carrier']);
- $message = stripslashes($_POST['message']);
- if ($carrier == "verizon") {
- $formatted_number = $to."@vtext.com";
- mail("$formatted_number", "Msg from Website", "$message");
- // Currently, the subject is set to "SMS". Feel free to change this.
- echo '<div class="notification_error">'.$error.'</div>';
- }
- else if ($carrier == "tmobile") {
- $formatted_number = $to."@tomomail.net";
- mail("$formatted_number", "SMS", "$message");
- echo '<div class="notification_error">'.$error.'</div>';
- }
- else if ($carrier == "sprint") {
- $formatted_number = $to."@messaging.sprintpcs.com";
- mail("$formatted_number", "SMS", "$message");
- echo '<div class="notification_error">'.$error.'</div>';
- }
- else if ($carrier == "att") {
- $formatted_number = $to."@txt.att.net";
- mail("$formatted_number", "SMS", "$message");
- echo '<div class="notification_error">'.$error.'</div>';
- }
- else if ($carrier == "virgin") {
- $formatted_number = $to."@vmobl.com";
- mail("$formatted_number", "SMS", "$message");
- $error = '';
- // Check name
- if(!$from)
- {
- $error .= 'Please Enter Your Name.<br />';
- }
- // Check recipient
- if(!$to)
- {
- $error .= 'Please Enter Recipient Phone Number<br />';
- }
- // Check message (length)
- if(!$message)
- {
- $error .= "Please Type Your Message.<br />";
- }
- {
- echo 'OK';
- }
- }
- else
- {
- echo '<div class="notification_error">'.$error.'</div>';
- }
- ?>
Thanks!
-Bruce