How to write javascript to do following requirement:
I have written code like
this:
How can i write the javascript
to do the requirement.
<!DOCTYPE html>
<html>
<body>
<form>
<label for="Name">Name</label>
<input type="text" id="Name" name="Name"
onblur="NameValid()"/><br/>
<label for="email">Email</label>
<input type="text" id="email" name="email"
onblur="EmailValid()"/><br/>
<label for="phone number">Phone Number</label>
<input type="text" id="phone_number" name="phone number"
onblur="NumberValid()"/><br/>
</form>
<script>
function NameValid() {
var x = document.getElementById("Name").value;
var n = x.length;
if(n<5)
{
alert("Text should be at least 5 character");
}
}
function NumberValid() {
var x = document.getElementById("phone_number").value;
var n = x.length;
if(isNaN(x)){
alert("Not a number");
}
else
{
if(n<5)
{
alert("Text should be exactly 10 character");
}
}
}
function EmailValid() {
var x = document.getElementById("email").value;
var n = x.length;
if(n<8)
{
alert("Text should be at least 8 character");
}
}
</script>
</body>
</html>
How to write javascript to do following requirement: I have written code like this: How can...
I need to complete 3 validation cases in this Javascript code. I need to validate email, phone and street address. How would I go about validating these 3 cases in this code: <!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <title>Week 10: Regular Expressions</title> <style type="text/css"> span { padding: 2px; } .success { color: #008000; background: #99cc99; } .failure { color: #ff0000; background: #ff9999; } </style> <script type="text/javascript"> function validateInput(form) { var result0 = document.getElementById('result0'), result1 = document.getElementById('result1'), result2 = document.getElementById('result2'),...
NEED HELP with HTML with Javascript embedding
for form validation project below. I have my code
below but I'm stuck with validation. If anyone can fix it, I'd
really appreciate.
******************************************************************************
CODE:
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project
Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<title>Nice</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,
initial-scale=1.0">
<script>
var textFromTextArea;
function getWords(){
var text =...
How can I print the Database table in PHP please ? here I have form for name and email, also I have php code that allow user to add his name and email to my database, all I need to print my final database when the user click on submit. <form action="" method="post"> <label>Name :</label> <input type="text" name="name" required="required" placeholder="Please Enter Name"/><br /><br /> <label>Email :</label> <input type="email" name="email" required="required" /><br/><br /> <input type="submit" value=" Submit " name="submit"/><br /> </form>...
PHP code that is given :
<?php
// Here is where your preprocessing code goes
// An example is already given to you for the First Name
$fname = $_GET['fname'];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Exercise 2 - GET Echo</title>
<style>
body {
margin:0;
padding:0;
font-family: Arial;
}
form {
margin:20px;
}
input[type="text"], input[type="password"] {
width:150px;
padding:3px;
font-size:1em;
}
input[type="submit"] {
padding:3px;
font-size:1em;
}
label {
display:inline-block;
width:150px;
}
.input-container {
padding:5px;
}
</style>
</head>
<body>
<form...
in the following java script code follow the instructions provided <!DOCTYPE html> <html> <head> <!-- JavaScript 6th Edition Chapter 5 Hands-on Project 5-2 Author: Date: Filename: index.htm --> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Hands-on Project 5-2</title> <link rel="stylesheet" href="styles.css" /> <script src="modernizr.custom.05819.js"></script> </head> <body> <header> <h1> Hands-on Project 5-2 </h1> </header> <article> <h2>Change of address form</h2> <form> <fieldset id="contactinfo"> <label for="addrinput"> Street Address </label> <input type="text" id="addrinput" name="Address" /> <label for="cityinput"> City </label> <input type="text" id="cityinput" name="City"...
I have created an HTML form. I need to connect this to a database to update the phone number in the employee table HTML: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> </head> <body link="#0000EE" vlink="#551A8B" text="#000000" bgcolor="#566573" alink="#EE0000" background="../DOC/brushed-alum.png"> <form method="post" action="phonenumbers.php"> <h1>Update Employee Phone Number Form</h1> <br> <br> <h3>Enter the employee's ID number.</h3> <br> <br> Employee ID Number: <input name="EmployeeNumber" type="text"> <br> <br> <h3>Enter the new phone number</h3> Phone Number: <input name="OfficePhone" type="text">...
Javascript on implementing dynamic calculation using a form. How do I get the text in the yellow box to display "You can play FGO!" when all yeses are checked, or "You cannot play FGO!" otherwise? <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Form</title> <link rel="stylesheet" href="css\survey.css"> <script src="js\survey.js"></script> </head> <body> <form id="part1"> <fieldset> <legend>Can you play FGO?</legend> <p>Do you have a smartphone?: ...
For this code below, I need to add the form information to mysql when I click on submit, at the same time when I click on submit I need to move to another page like Welcome.php WITH NOTE THAT THE ENTERED INFORMATION NOW ALREADY IN DATABASE how can I male that with my code below? THANKS ................................................................................................................................................ <form method="POST"> <div class="container"> <label for="fname"><b>First Name</b></label> <input type="text" placeholder="Enter First Name" name="fname" required> <label for="lname"><b>Last Name</b></label> <input type="text" placeholder="Enter Last Name"...
I have the code buts its not working as this below instruction can anyone help Use the requirements from the pizza part of Assignment 6 and do the following using CSS and an internal style sheet: 1. Your Javascript function should be in an external file (don’t forget to move it up to studentweb too) 2. Put a red border of 300px in width around the form 3. There should be three Div sections: header, main_body, and footer. 4. Center the name of your...
Modify the following file, so that: If the user input for the age input box is empty, please send the user a warning message: “Age field cannot be empty” and return to the form web page to allow the user to re-input the age; If the user input for the age input box is incorrect (e. g. less than 1), please also send the user a warning message: “Your age input is not correct!” and return to the form web...