Jump to content

Text a Phone from your computer?!?!


suess0r

Recommended Posts

hey guys,

i've been playing with a way to have a user input their name and phone number and have a script to generate a text message to send to that phone. I've found some information on it in Cold Fusion but would like to keep it in javascript if that was possible.. here's what i've got

[quote]
<script language="javascript">
<!--
function validateit()
{
temp = true;
if(document.form.name.value == '' || document.form.phone.value == '')
{
temp = false;
alert('Please fill out the Name and Phone field to continue...');
}
return temp;
}
//-->
</script>
</head>
<body>
<p align="center"><strong>INSTANT CALL BACK</strong><br>enter you name and number<br>and I will call you immediately.</p>
            <form name="form" action="sampleproc.cfm" method="post" enctype="multipart/form-data" onSubmit="return validateit();">
<table width="300" border="0" align="center" cellpadding="2" cellspacing="0">     
  <tr>
                <td width="125" valign="middle"> <div align="right">Your Name:&nbsp; </div></td>
                <td width="150" valign="top"><input type="text" name="name" onFocus="this.value=''" style="width:150px"></td>
    <td width="25" valign="middle"><div align="center">*</div></td>
  </tr>
              <tr>
                <td valign="middle"> <div align="right">Phone Number:&nbsp; </div></td>
                <td valign="top"><input type="text" name="phone" onFocus="this.value=''" style="width:150px" ></td>
                <td valign="middle"><div align="center">*</div></td>
              </tr>
              <tr>
                <td valign="top"><div align="right">
                  </div></td>
                <td valign="top"><div align="right">
                  <input type="submit" name="Submit" value="Call Me">
                </div></td>
                <td valign="top">&nbsp;</td>
              </tr>
            </table>
</form>
[/quote]

and here's my sampleproc.cfm code, but it's saying "The requested method POST is not allowed for the URL /sampleproc.cfm." uggggg....

[quote]<CFMAIL To="phonenumber@cellphoneprovider.com" From="you@youremail.com" Subject="Web Alert" server="mail.yourmailserver.com">
call #form.name# at #form.phone#
FROM WEB SITE, Instant Call Back
</CFMAIL>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Confirmation</title>
<script language="javascript" type="text/javascript">
alert( "I have received your request and will be contacting you shortly" );
location.href = "sample.htm";
</script>
</head><body></body></html>[/quote]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.