Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

AUTO FILL TEXT BOX

Posted on 2011-10-01
4
Medium Priority
?
219 Views
Last Modified: 2012-05-12
I have a form in html and i want when someone press a number in "Phone" text box like 2106
i have a table with 3 columns "from" "to" "area " in a database-MYSQL or CSV-textfile
i want to check while pressing or when this text box lose focus to check ...

if phone > from and phone < to then show area in another text box else the other text box empty

*sorry for my english
0
Comment
Question by:rockas1982
  • 2
  • 2
4 Comments
 
LVL 13

Expert Comment

by:Hugh McCurdy
ID: 36897481
Unfortunately, I don't understand what you want.  Javascript is likely what you need to solve the problem.  I don't know how well you know Javascript so I'll direct you w3 schools.  Perhaps you can find something similar to what you want done and we can proceed from that point.

http://www.w3schools.com/js/
0
 
LVL 1

Author Comment

by:rockas1982
ID: 36897497
look it's very simple

i have a form with 2 fields phone and location

when someone press on the phone a number like 5

i want to search a table or an array whatever is easier and search inside it

like this
select location where phone > from and phone < to
and i want the result to be shown in the second filed  
0
 
LVL 1

Author Comment

by:rockas1982
ID: 36897532
Something like this

<html>
<head>
<script type="text/javascript">
function changetext(){
	var userInput = document.getElementById('phone').value;
	document.getElementById('area').value = userInput;
}
</script>
<input type='text' onKeyup='changetext()' id='phone' value='' />
<br>
<input type='text' id='area' value='' />

</body>
</html> 

Open in new window


but i want the second value to be searched inside a table or inside an array
0
 
LVL 13

Accepted Solution

by:
Hugh McCurdy earned 2000 total points
ID: 36899589
I'm not sure I understand yet.  Sounds like you are OK with the Javascript - right?

Do you need help searching SQL or XML?

Note: if you want to abandon this thread to award zero points and start a new thread with a different title (to attract more attention), I will not issue an objection.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
This article discusses how to implement server side field validation and display customized error messages to the client.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
Suggested Courses

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question