Question

In: Computer Science

E-commerce Question Study the scenario and complete the question(s) that follow: Assume you and your university...

E-commerce Question

Study the scenario and complete the question(s) that follow:
Assume you and your university friends have a new start-up company called MealsOnWheels. The goal
of the start-up is to provide the services of a chef on demand. The business is located in Vorna Valley,
Midrand. In addition to mobile chef services, you also provide health and wellness services.
After careful deliberation, you have decided that your start-up needs a website to assist in increasing its
client base.
As part of your communication pathways, you have decided to incorporate a chat page that allows
clients to chat with a chef who will answer their questions. It is expected that the chef is assigned based
on their field of expertise. The aim of the chat page is to ensure that clients are served efficiently and
effectively.


Question
Design a registration page, login page, chat page and database based on the scenario above.
Successful authentication should result in a chat page dynamically designed based on the
requirements of the client. The client should be matched to the appropriate chef. Kindly apply
JavaScript validation where necessary.

Solutions

Expert Solution

HTML Code of the Sample Registration Form:

<!DOCTYPE html>
<html lang="en"><head>
<meta charset="utf-8">
<title>JavaScript Form Validation using a sample registration form</title>
<meta name="keywords" content="example, JavaScript Form Validation, Sample registration form" />
<meta name="description" content="This document is an example of JavaScript Form Validation using a sample registration form. " />
<link rel='stylesheet' href='js-form-validation.css' type='text/css' />
<script src="sample-registration-form-validation.js"></script>
</head>
<body onload="document.registration.userid.focus();">
<h1>Registration Form</h1>
Use tab keys to move from one input field to the next.
<form name='registration' onSubmit="return formValidation();">
<ul>
<li><label for="userid">User id:</label></li>
<li><input type="text" name="userid" size="12" /></li>
<li><label for="passid">Password:</label></li>
<li><input type="password" name="passid" size="12" /></li>
<li><label for="username">Name:</label></li>
<li><input type="text" name="username" size="50" /></li>
<li><label for="address">Address:</label></li>
<li><input type="text" name="address" size="50" /></li>
<li><label for="country">Country:</label></li>
<li><select name="country">
<option selected="" value="Default">(Please select a country)</option>
<option value="AF">Australia</option>
<option value="AL">Canada</option>
<option value="DZ">India</option>
<option value="AS">Russia</option>
<option value="AD">USA</option>
</select></li>
<li><label for="zip">ZIP Code:</label></li>
<li><input type="text" name="zip" /></li>
<li><label for="email">Email:</label></li>
<li><input type="text" name="email" size="50" /></li>
<li><label id="gender">Sex:</label></li>
<li><input type="radio" name="msex" value="Male" /><span>Male</span></li>
<li><input type="radio" name="fsex" value="Female" /><span>Female</span></li>
<li><label>Language:</label></li>
<li><input type="checkbox" name="en" value="en" checked /><span>English</span></li>
<li><input type="checkbox" name="nonen" value="noen" /><span>Non English</span></li>
<li><label for="desc">About:</label></li>
<li><textarea name="desc" id="desc"></textarea></li>
<li><input type="submit" name="submit" value="Submit" /></li>
</ul>
</form>
</body>
</html>


CSS Code of the Sample Registration Form:


h1 {
margin-left: 70px;
}
form li {
list-style: none;
margin-bottom: 5px;
}

form ul li label{
float: left;
clear: left;
width: 100px;
text-align: right;
margin-right: 10px;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:14px;
}

form ul li input, select, span {
float: left;
margin-bottom: 10px;
}

form textarea {
float: left;
width: 350px;
height: 150px;
}

[type="submit"] {
clear: left;
margin: 20px 0 0 230px;
font-size:18px
}

p {
margin-left: 70px;
font-weight: bold;
}

JavaScript code for validation:

function formValidation()
{
var uid = document.registration.userid;
var passid = document.registration.passid;
var uname = document.registration.username;
var uadd = document.registration.address;
var ucountry = document.registration.country;
var uzip = document.registration.zip;
var uemail = document.registration.email;
var umsex = document.registration.msex;
var ufsex = document.registration.fsex; if(userid_validation(uid,5,12))
{
if(passid_validation(passid,7,12))
{
if(allLetter(uname))
{
if(alphanumeric(uadd))
{
if(countryselect(ucountry))
{
if(allnumeric(uzip))
{
if(ValidateEmail(uemail))
{
if(validsex(umsex,ufsex))
{
}
}
}
}
}
}
}
}
return false;
}

JavaScript function for validating userid:

function userid_validation(uid,mx,my)
{
var uid_len = uid.value.length;
if (uid_len == 0 || uid_len >= my || uid_len < mx)
{
alert("User Id should not be empty / length be between "+mx+" to "+my);
uid.focus();
return false;
}
return true;
}

JavaScript function for validating password:

function passid_validation(passid,mx,my)
{
var passid_len = passid.value.length;
if (passid_len == 0 ||passid_len >= my || passid_len < mx)
{
alert("Password should not be empty / length be between "+mx+" to "+my);
passid.focus();
return false;
}
return true;
}

JavaScript code for validating user name:

function allLetter(uname)
{
var letters = /^[A-Za-z]+$/;
if(uname.value.match(letters))
{
return true;
}
else
{
alert('Username must have alphabet characters only');
uname.focus();
return false;
}
}

JavaScript code for validating user address:

function alphanumeric(uadd)
{
var letters = /^[0-9a-zA-Z]+$/;
if(uadd.value.match(letters))
{
return true;
}
else
{
alert('User address must have alphanumeric characters only');
uadd.focus();
return false;
}
}


Related Solutions

E-commerce Question Study the scenario and complete the question(s) that follow: Tshepiso Florists is a small...
E-commerce Question Study the scenario and complete the question(s) that follow: Tshepiso Florists is a small flower business located in the Glen Austin neighbourhood. There are two main types of clients that patronise Tshepiso Florists – gardening enthusiasts and people who need to send flowers to their loved ones on special occasions. Tshepiso is starting a gardening class online and she would like to send a notification via email to a particular group of clients. Create a database of at...
USING C++ Study the scenario and complete the question(s) that follow: Postfix using Stacks The rules...
USING C++ Study the scenario and complete the question(s) that follow: Postfix using Stacks The rules to convert an infix expression into an equivalent postfix expression are as follows: Suppose infx represents the infix expression and pfx represents the postfix expression. The rules to convert infx into pfx are as follows: 1. Initialize pfx to an empty expression and also initialize the stack. 2. Get the next symbol, sym, from infx. a. If sym is an operand, append sym to...
Assume you were just assigned as lead auditor for a new e-commerce client. This is your...
Assume you were just assigned as lead auditor for a new e-commerce client. This is your client’s first year in business. Identify general business strategies that might explain your client’s decision to enter the e-commerce space with the likes of giants such as Amazon. Considering these strategies, identify potential business risks that can lead to material misstatements in your client’s financial statements. Be sure to include new start-up and e-commerce risks. What are some other things your team will need...
length 1200 words: Question; What is your opinion of e-business and e-commerce and their roles in...
length 1200 words: Question; What is your opinion of e-business and e-commerce and their roles in today’s world of business? Analyse a case study to support your ideas.
Assume you are conducting a parking study in your University. You need to explain the processes/tasks...
Assume you are conducting a parking study in your University. You need to explain the processes/tasks that you will undertake to complete this study. You need to explain how you will do different tasks and how you will present the collected data.
Assume you are conducting a parking study in your University. You need to explain the processes/tasks...
Assume you are conducting a parking study in your University. You need to explain the processes/tasks that you will undertake to complete this study. You need to explain how you will do different tasks and how you will present the collected data.
You are asked to conduct a five-year economic feasibility study of an e-commerce site for a...
You are asked to conduct a five-year economic feasibility study of an e-commerce site for a small office supply company. Due to construction time, the system will only be in operation for 6 months for the current year (Year 1). Once the system is in operation, you expect to reduce staff cost by $37,000 and to reduce printing/postage cost by $12,000 for a full year of operation between year 1 and year 3. The numbers will be $38,000 and $15,000,...
Assume you are the CEO of an U.S.-based e-commerce company that wants to expand internationally by...
Assume you are the CEO of an U.S.-based e-commerce company that wants to expand internationally by exporting a product or service to one of the BRICS countries: Brazil, Russia, India, China, or South Africa. First, you should choose and describe the product or service you want to export. Second, you should evaluate the business environment in the chosen country and explain why you chose this country. Third, you should evaluate the market potential for your product/service in the chosen country....
Assume you are the CEO of an U.S.-based e-commerce company that wants to expand internationally by...
Assume you are the CEO of an U.S.-based e-commerce company that wants to expand internationally by exporting a product or service to one of the BRICS countries: Brazil, Russia, India, China, or South Africa. First, you should choose and describe the product or service you want to export. Second, you should evaluate the business environment in the chosen country and explain why you chose this country. Third, you should evaluate the market potential for your product/service in the chosen country....
Select an e-commerce company of your choice & based on the information you found on their...
Select an e-commerce company of your choice & based on the information you found on their website, briefly 0. Describe their business model 1. Identify their customer value proposition 2. Identify its revenue model 3. Identify their main competitors 4. Identify their market strategy Ecommerce Website: flipkart.com
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT