[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.4

Trying to incorporate following code into existing javascript

Asked by TrueBlue in JavaScript

Tags: javascript, captcha

Hello,

I am trying to incorporate the following code into an existing javascript that checks data inputted into a form.
I added a field just above the submit button on the asp form that incorporates captcha to reduce the amount of spam we are getting. The field and value is working fine. Just need a way to keep someone from getting past entering the correct value before the email is sent.

I need to add at the top somehow:

<!-- Include file for CAPTCHA form processing -->            
<!-- #include file="CAPTCHA/CAPTCHA_process_form.asp" -->

And some kind of code to check the variable (blnCAPTCHAcodeCorrect) for a false condition and then clear the field and give the below error: (I know this is vbscript, but I do not know the javascript equivalent syntax).

 If blnCAPTCHAcodeCorrect = False Then Response.Write(" CAPTCHA code is NOT correct, please press the Load New   Code link and enter the new value")
End If

Here is the code that creates the field, etc in the asp form:

<table width="100%" border="0" cellspacing="1" cellpadding="3">
 <tr>
  <td><img src="CAPTCHA/CAPTCHA_image.asp" alt="Code Image - Please contact webmaster if you have problems seeing this image code" id="CAPTCHA" />&nbsp;<a href="javascript:reloadCAPTCHA();"><% = strTxtLoadNewCode %></a></td>
 </tr>
 <tr>
  <td><input type="text" name="securityCode" id="securityCode" size="12" maxlength="12" autocomplete="off" /></td>
 </tr><%

Here is the working script for the form:

// <!--
function validateForm(theForm)
{
     var isPhone = /^\([1-9]\d{2}\)\s?\d{3}\-\d{4}$/; // (000)000-0000 or (000) 000-0000
     var isEmail = /^[a-z][a-z0-9]*([.\-_][a-z][a-z0-9]*)*@([a-z][a-z0-9]*.)*([a-z]{2}|com|net|org|biz|gov|pro|int|mil|edu|info|name|aero|coop|museum)$/i;
     if(theForm.Name.value.split(" ").join("") == "")
     {
          alert("Please enter your Name.");
          theForm.Name.select();
          theForm.Name.focus();
          return (false);
     }
     if(theForm.Name.value.length > 70)
     {
          alert("Please enter at most 70 characters in the Name field.");
         theForm.Name.focus();
         return (false);
     }
     if(theForm.EmailAddress.value.split(" ").join("") == "")
     {
          alert("Please enter a Email Address.");
          theForm.EmailAddress.select();
          theForm.EmailAddress.focus();
          return (false);
     }
     if (!isEmail.test(theForm.EmailAddress.value))
     {
         alert("The Email Address is NOT in the corect format.");
         theForm.EmailAddress.focus();
         return (false);
     }
      if (theForm.EmailAddress.value.length > 35)
       {
         alert("Please enter at most 35 characters in the Email Address field.");
         theForm.EmailAddress.focus();
         return (false);
       }
     if (theForm.DaytimePhone.value.split(" ").join("") == "")
     {
          alert("Please enter a Daytime Phone Number.");
          theForm.DaytimePhone.select();
          theForm.DaytimePhone.focus();
          return (false);
     }
     if (!isPhone(theForm.DaytimePhone.value))
     {
          alert("The Phone Number is NOT in the correct format:\n...(000)000-0000 or (000) 000-0000.");
          theForm.DaytimePhone.focus();
          return (false);
     }
     if (theForm.DaytimePhone.value.length > 14)
     {
          alert("Please enter at most 14 characters in the \"Daytime Phone\" field.");
          theForm.DaytimePhone.focus();
          return (false);
     }
     return (true);
}
// -->

Hope this makes sense.

Thank you in advance.
[+][-]11/21/06 04:33 PM, ID: 17992074Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/21/06 05:04 PM, ID: 17992188Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/22/06 07:11 PM, ID: 18000667Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/23/06 06:03 AM, ID: 18002888Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/23/06 09:14 PM, ID: 18005884Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/24/06 07:14 AM, ID: 18007790Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/25/06 06:11 PM, ID: 18013185Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/27/06 08:47 AM, ID: 18020495Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/27/06 09:43 AM, ID: 18020963Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: JavaScript
Tags: javascript, captcha
Sign Up Now!
Solution Provided By: b0lsc0tt
Participating Experts: 1
Solution Grade: A
 
[+][-]11/27/06 11:11 AM, ID: 18021673Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091021-EE-VQP-81