Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8616465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:37:34+00:00 2026-06-12T05:37:34+00:00

I have an assignment that I think I am almost complete but my head

  • 0

I have an assignment that I think I am almost complete but my head won’t give for much more, maybe I can be assited; my assignment called to create a html form that collects user data and validates user info; which I think I have correctly done. Now I have this instruction which I do not understand but think it is after the validation process “The merchandize items should include a link to the same or similar items on amazon.com or other retailor sites so that the potential buyers can have a better knowledge of the item and price of the new;” then I must have a thumbs-up image pop-up after the user clicks on the Submit button but I already have my validation form in the onclick.

Here’s my code:

 <script language="JavaScript" type="text/javascript">

 //Function to validate form

 function validateForm() {

     //Variables are declared

     var s=document.forms["craigslistSalesForm"]["itemName"].value;
     var t=document.forms["craigslistSalesForm"]["itemPrice"].value;
     var u=document.forms["craigslistSalesForm"]["location"].value;
     var v=document.forms["craigslistSalesForm"]["itemCondition"].value;
     var w=document.forms["craigslistSalesForm"]["itemDescription"].value;

     //If itemName is entered continue but if left blank show alert
     if (s==null || s=="") {
     alert("Please enter a title for your posting");
     return false;
     }

     //If itemPrice is entered continue but if left blank show alert
     if (t==null || t=="") {
     alert("Please enter the price of your item");
     return false;
     }

     //If location is entered continue but if left blank show alert
     if (u==null || u=="") {
     alert("Please enter your location");
     return false;
     }

     //If itemCondition is entered continue but if left blank show alert
     if (v==null || v=="Select a condition option") {
     alert("Please choose the condition of your item from the list");
     return false;
     }

     //Variables are declared

     var x=document.forms["craigslistSalesForm"]["email"].value;
     var atpos=x.indexOf("@");
     var dotpos=x.lastIndexOf(".");
     var y=document.forms["craigslistSalesForm"]["email2"].value;

     //If email address doesn't contain symbol @ or . and a minimum 2 characters
     //after dot then alert to correct email address
     if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length) {
     alert("Your email address must be in the format of name@domain.com");
     return false;
     }

     //If second email address does not match first email then alert mis-match
     if (y!=x) {
     alert("Ooops! Your email does not match, please try again.");
     return false;
     }

     //If itemDescription is entered continue but if left blank show alert
     if (w==null || w=="") {
     alert("You must describe your Item for Sale");
     return false;
     }

     }

 </script>

 <html>
 <head>
 <title>Project Task #1 - AGV</title>
 </head>
 <body onload="document.getElementById('itemName').focus()" bgcolor="E1E1E1">
 <form id="craigslistSalesForm">
 <h2>PA Craigslist - Items for sale</h2>
 <div>
 <span>Posting Title:&#160; </span><input tabindex="1" type="text" name="itemName"
 id="itemName" size="35" maxlength="64" value>
 &#160; &#160; <span>Price:&#160; </span>$<input type="text" name="itemPrice"
 id="itemPrice" size="6" maxlength="9" value>
 </div>
 <br>
 <div>
 <span>Location:&#160; &#160; </span><input type="text" name="location"
 id="location" size="35" maxlength="64" value>
 &#160; &#160; &#160; <span>Item condition:&#160; </span>
                 <select id="itemCondition" value>
                 <option>Select a condition option</option>
                 <option>New</option>
                 <option>Like new (in original packaging)</option>
                 <option>Like new (without original packaging
 </option>
                 <option>Fairly used</option>
                 <option>Used</option>
                 <option>Rough condition</option>
                 <option>Working</option>
                 <option>Not working</option>
                 <option>I don't know</option>
                 </select>
 </div>
 <div>
 &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;
 &#160;
 <input type="radio" value="Residential" name="typeOfLocation" CHECKED>Residential
 &#160; &#160; <input type="radio" value="Business" name="typeOfLocation">Business
 </div>
 <br>
 <div>
 <span>Your email:&#160; </span><input type="text" name="email" id="email"
 size="35" maxlength="64" value>
 &#160; &#160; <span><i>Retype your email:&#160; </i></span><input type="text"
 name="email2" id="email2" size="35" maxlength="64" value>
 </div>
 <br>
 <div>
 <span><b>Item Description:</b></span>
 <br>
 <textarea cols="80" name="itemDescription" id="itemDescription" style="width: 70%;
 border: 3px solid black; font-family: Calibri; font-size: 24px;" rows="10"></textarea>
 </div>
 <button type="button" value="callTwoFunctions" onclick="validateForm()">
 <b>Submit</b></button>
 </form>
 </body>
 </html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T05:37:36+00:00Added an answer on June 12, 2026 at 5:37 am

    In your script you can have additional entry below of all validations you perform, which is accepted as a successful validation result:

    function validateForm() {
    
     //Variables are declared
    
     var s=document.forms["craigslistSalesForm"]["itemName"].value;
     var t=document.forms["craigslistSalesForm"]["itemPrice"].value;
     var u=document.forms["craigslistSalesForm"]["location"].value;
     var v=document.forms["craigslistSalesForm"]["itemCondition"].value;
     var w=document.forms["craigslistSalesForm"]["itemDescription"].value;
    
     //If itemName is entered continue but if left blank show alert
     if (s==null || s=="") {
     alert("Please enter a title for your posting");
     return false;
     }
    
     //If itemPrice is entered continue but if left blank show alert
     if (t==null || t=="") {
     alert("Please enter the price of your item");
     return false;
     }
    
     //If location is entered continue but if left blank show alert
     if (u==null || u=="") {
     alert("Please enter your location");
     return false;
     }
    
     //If itemCondition is entered continue but if left blank show alert
     if (v==null || v=="Select a condition option") {
     alert("Please choose the condition of your item from the list");
     return false;
     }
    
     //Variables are declared
    
     var x=document.forms["craigslistSalesForm"]["email"].value;
     var atpos=x.indexOf("@");
     var dotpos=x.lastIndexOf(".");
     var y=document.forms["craigslistSalesForm"]["email2"].value;
    
     //If email address doesn't contain symbol @ or . and a minimum 2 characters
     //after dot then alert to correct email address
     if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length) {
     alert("Your email address must be in the format of name@domain.com");
     return false;
     }
    
     //If second email address does not match first email then alert mis-match
     if (y!=x) {
     alert("Ooops! Your email does not match, please try again.");
     return false;
     }
    
     //If itemDescription is entered continue but if left blank show alert
     if (w==null || w=="") {
     alert("You must describe your Item for Sale");
     return false;
     }
    
    
     // A place to do additional thing after successful validation
     // you can have another function call
     // i.e. popupImageContainer();
    
     alert("Yahoo validation is successful lets put another function calls instead this alert code");
    
     }
    

    … also you can have your other function that pops up something by appending its call after validateForm() function in your onclick event in button tag:

    `<button type="button" value="callTwoFunctions" onclick="validateForm();popupDialog();">`
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, so I have an assignment to code (using Java,but I don't think that
I have an assignment that wants me to write an ternary search algorithm and
I have an assignment that simulates a dice game. As part of the program,
I have quite a large XSL document for an assignment that does a number
My assignment requires that I have an ER diagram that shows the dependencies between
For a school assignment I have to create a C++ program that will create
For an assignment in college, we have to make a script in Perl that
I'd like to use the following idiom, that I think is non-standard. I have
I know that I can't get a specific answer to my question, but I
I have an assignment that requires us to implement a doubly linked list class.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.