<!DOCTYPE html> <html> <head> <title> praneet.16p3.php </title> <script> functio
ID: 3822240 • Letter: #
Question
<!DOCTYPE html>
<html>
<head>
<title> praneet.16p3.php </title>
<script>
function allnumeric(inputtxt)
{
var numbers = /^[0-9]+$/;
// For count_network
if(inputtxt.count_network.value.match(numbers) inputtxt.count_memory.value.match(numbers) inputtxt.count_hdd.value.match(numbers))
{
alert('Your Registration number has accepted....');
inputtxt.count_network.focus();
return true;
}
else
{
alert('Please input numeric characters only');
inputtxt.count_memory.focus();
return false;
}
}
</script>
</head>
<body>
<form name = "myform" action="/formtest.php">
Customer name:
<input type="text" name="Customer">
<br><br>Address:
<input type="text" name="address">
<br><br>
State:
<select name="state">
<?php
$arr=array(" Georgia", "Alabama"," Florida");
for($i=0;$i<count($arr);$i++) {
echo "<option value='" . $arr[$i] ."'>" . $arr[$i] ."</option>";
}
?>
</select>
<br><br>
<p>Payment Choices</p>
<input type="radio" name="payment" value="Visa" id="VisaPayment" checked>
<label for="VisaPayment"> Visa</label><br>
<input type="radio" name="payment" value="MasterCard" id="MasterCardPayment" >
<label for="MasterCardPayment"> MasterCard</label><br>
<input type="radio" name="payment" value="AmericanExpress" id="AmericanExpressPayment" >
<label for="AmericanExpressPayment"> AmericanExpress</label>
<br><br>
<b> Enter quantity :-</b>
<br><br>
List-Memory Upgrade :- <input type="text" name="count_memory" id = "count_memory">
<br><br>
List-HDD Upgrade :- <input type="text" name="count_hdd" id = "count_hdd">
<br><br>
List- Network Upgrade :- <input type="text" name="count_network" id = "count_network">
<br><br>
<input type="submit" name="submit" value="Submit">
</form>
</body>
</html>
when I validate,following errors occur.please fix these errors and update it
Warning: The preferred Content-Type for XHTML5 is application/xhtml+xml. The Content-Type was application/octet-stream.
Error: Unnamespaced element html not allowed in this context. (Suppressing further errors from this subtree.)
From line 1, column 16; to line 2, column 6
TYPE html><html><hea
Fatal Error: reference to undeclared general entity nbsp
At line 54, column 20
omer name: &
Please fix these errors and update it
Explanation / Answer
I tried from my Netbean IDE with creating a new HTML 5 Application with no site template .
After the project is created then i added yours file to my index.html file and then run the file in both chrome and IE also didn't find any error while validating the code.
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
<head>
<META CHARSET="UTF-8">
<title></title>
<script>
function allnumeric(inputtxt)
{
var numbers = /^[0-9]+$/;
// For count_network
if(inputtxt.count_network.value.match(numbers) && inputtxt.count_memory.value.match(numbers) && inputtxt.count_hdd.value.match(numbers))
{
alert('Your Registration number has accepted....');
inputtxt.count_network.focus();
return true;
}
else
{
alert('Please input numeric characters only');
inputtxt.count_memory.focus();
return false;
}
}
</script>
</head>
<body>
<form name = "myform" action="/formtest.php">
Customer name:
<input type="text" name="Customer">
<br><br>Address:
<input type="text" name="address">
<br><br>
<p>Payment Choices</p>
<input type="radio" name="payment" value="Visa" checked>
<label for="Visa"> Visa</label><br>
<input type="radio" name="payment" value="MasterCard">
<label for="MasterCard"> MasterCard</label><br>
<input type="radio" name="payment" value="AmericanExpress">
<label for="AmericanExpress"> AmericanExpress</label>
<br><br>
<b> Enter quantity :-</b>
<br><br>
List-Memory Upgrade :- <input type="text" name="count_memory" id = "count_memory">
<br><br>
List-HDD Upgrade :- <input type="text" name="count_hdd" id = "count_hdd">
<br><br>
List- Network Upgrade :- <input type="text" name="count_network" id = "count_network">
<br><br>
<input type="submit" name="submit" value="Submit">
</form>
</body>
</html>
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.