Question

I create an address book where the user enters the name, phone and email in the...

I create an address book where the user enters the name, phone and email in the input field. This is stored in a list that adds up and shows it in a table below.
How can I use a search box to filter the list using a search box?
I use SIMPLE javascript and HTML.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

The implementation is below,

<!DOCTYPE html>
<html>
<body>


<label for="name">Name:</label><br>
<input type="text" id="name" name="name"><br>
<label for="phone">Phone:</label><br>
<input type="text" id="phone" name="phone"><br>
<label for="email">Phone:</label><br>
<input type="text" id="email" name="email"><br><br>
<button onclick=postValues()>Go</button><br><br>


<label for="find">FindName:</label><br>
<input type="text" id="find" name="find"><br>
<button onclick=getValue()>Find</button>
<p id="output"></p>
<script>
var data = [];
function postValues(){
   var Name = document.getElementById('name').value;
   var Phone = document.getElementById('phone').value;
   var Email = document.getElementById('email').value;
var input = {};
input["Name"] = Name;
input["Phone"] = Phone;
input["Email"] = Email;
data.push(input);
}
function getValue(){
   var input = document.getElementById('find').value;
   for(index=0;index<data.length;index++){
       var value = data[index];
if(value.Name == input){
   var output = "Name : " + value.Name + " Phone : " + value.Phone + " Email : " + value.Email;
document.getElementById('output').innerHTML = output;
}
}
}
</script>
</body>
</html>

Hope its useful , Thank You :).

Add a comment
Know the answer?
Add Answer to:
I create an address book where the user enters the name, phone and email in the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Create an application where a user can make a phone book such as name, email address,...

    Create an application where a user can make a phone book such as name, email address, phone number.....etc

  • Create an address book. Given a list of people addresses, create a procedure that allows a...

    Create an address book. Given a list of people addresses, create a procedure that allows a user to search for a particular name and returns the address from the table. (Refer to worksheet "14.23") Search for the name using the match function and the Application object. Name the range that contains the names in the address table. Then use the Offset property (Cells property) to gather the corresponding information. You may need to name another range to make this easier....

  • PHP you need to create a form to allow the user to enter their name, email,...

    PHP you need to create a form to allow the user to enter their name, email, and address information. That information will be sent to a PHP script that will process and display that information. Your assignment should have two pages. The first page is straight html (user_input.html) that has a form with the appropriate form elements to collect the user input. The form should then be submitted using the POST method to a php script (display_user_info.php) that will process...

  • PHP, HTML, CSS I have to make a website for a health club. Or a spa. Or some other kind of business where you have a mem...

    PHP, HTML, CSS I have to make a website for a health club. Or a spa. Or some other kind of business where you have a membership and keep track of transactions for those customers. First I need to create a page where the customer is signed up for a membership. The fields should include: First name Last name Street Address City State Zip Code Email Phone Number I should create a table that has all of that data as...

  • PHP Create an HTML Form that asks for a series of personal information from the user,...

    PHP Create an HTML Form that asks for a series of personal information from the user, and once the user presses the [SUBMIT] button, sends the data to a PHP script that generates HTML code displaying the data entered. The form should have the following fields: First Name (using the text input type) Last Name (using the text input type) E-mail Address (using the email input type) Phone Number (using the tel input type) Date of Birth (using the date...

  • I need to complete 3 validation cases in this Javascript code. I need to validate email,...

    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'),...

  • in an input field, how can I check that the phone number contains only numbers and...

    in an input field, how can I check that the phone number contains only numbers and + - () and space? I use SIMPLE javascript and HTML.

  • Requirements Create an Address Book class in Java for general use with the following behaviors: 1....

    Requirements Create an Address Book class in Java for general use with the following behaviors: 1. Constructor: public Address Book Construct a new address book object. • A contact has four fields: first name, last name, email and phone. (There could be more information for a real contact. But these are sufficient for the assignment.) . The constructor reads from the disk to retrieve previously entered contacts. If previous contacts exist, the address book will be populated with those contacts...

  • In this lab assignment, you'll write code that parses an email address and formats the ci and zip...

    Using Microsoft Visual Studio C# In this lab assignment, you'll write code that parses an email address and formats the ci and zip code portion of an address. String Handling Email: [email protected] Parse City: Fresno State: ca Zp code: 93722 Format ให้ 2 Parsed String Formatted String User name: anne Domain name: murach.comm City, State, Zip: Fresno, CA 93722 OK OK Create a new Windows Forms Application named StringHandling and build the form as shown above. 1. Add code to...

  • 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...

    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>...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT