Dysan Posted February 7, 2008 Share Posted February 7, 2008 Using Ajax, Javascript, and a start and stop delimiter symbol "/". How do I enable the user to type directly onto a page, without using a textbox. Upon each character being entered, how do I search a data for the complete string? (Minus the "/")? If the string corresponds to an id/string in the database , how do I display a message, notifying the user that a record was found? The following code is what I have so far. This code enables the user to type directly onto a page. How do I add Ajax to the following code, in order to check the ID field in the database for the string entered onto the page? <script type='text/javascript'> var x=null; var y=null; var tId = ""; window.onload = function() { x = document.getElementById('x'); y = document.forms[0].copyField; document.onkeypress = myOnKeyPress; } function myOnKeyPress(e) { e = (e)?e:window.event; key = (e.keyCode)? e.keyCode: e.which; if (key==27) { x.innerHTML =""; // escape pressed to clear the field y.value =""; // remove if you do not want to clear field } else { x.innerHTML += String.fromCharCode(key); y.value = x.innerHTML; } } </script> Quote Link to comment https://forums.phpfreaks.com/topic/89890-search-database/ Share on other sites More sharing options...
haku Posted February 7, 2008 Share Posted February 7, 2008 This is the php section. While Ajax can access php documents, it isn't a php technology, so you are asking in the wrong place. That being said, even if you go to the right place (there is an ajax section of the forum), I doubt you are going to get an answer. Its one thing to ask someone to help you fix a script you can't get working, its another thing to ask for a lesson from scratch. If you are willing to pay the money to get it done, feel free to send me a private message. I'll write you script for you for a fee. How do I enable the user to type directly onto a page, without using a textbox A what? I don't think there is a such thing as a textbox. there are text inputs and text areas though. But assuming thats what you meant, you can't do what you are speaking of. Text can only be typed into a text input, a text area, or maybe a file input, although thats a little different. Quote Link to comment https://forums.phpfreaks.com/topic/89890-search-database/#findComment-460731 Share on other sites More sharing options...
Dysan Posted February 7, 2008 Author Share Posted February 7, 2008 Yes, but thats where your wrong, my above JavaScript script enables you to type directly onto the screen! - There is now signs of a textbox (text input) within my code! Work it out? How much would you be expecting to be paid? Quote Link to comment https://forums.phpfreaks.com/topic/89890-search-database/#findComment-460858 Share on other sites More sharing options...
amites Posted February 7, 2008 Share Posted February 7, 2008 think you guys could take this into private messages? I don't see it helping anyone else Quote Link to comment https://forums.phpfreaks.com/topic/89890-search-database/#findComment-461053 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.