By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,197 Members | 1,151 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,197 IT Pros & Developers. It's quick & easy.

help with ajax and javascript in php

P: 8
so basically i have a form which has an input type text for id and then i also have a input type text for name..

and then i also have a query in which it gets the matching name for that id.

sample : sql = "select name from names where id = '".$id."'";

how can i implement this concept in which, you can input the id and then the name of that corresponding id which automatically display in the name textbox..

Expand|Select|Wrap|Line Numbers
  1. <label>Id</label>
  2. <input type="text" name="id" id="id"/>
  3.  
  4. <label>Name</label>
  5. <input readonly="text" name="name" id="name" value="" />
  6.  
im new to javascript and ajax so i dont really know my way around it very much...i would really appreciate your help
Feb 13 '12 #1
Share this Question
Share on Google+
1 Reply


YarrOfDoom
Expert 100+
P: 1,247
Have a PHP-script output the value so an XMLHttpRequest-object in Javascript can request it.
You can find the details on how to do this here: W3Schools AJAX Tutorial
Feb 16 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.