I am creating one admin page where I have multiple textboxes.when I enter the userid in one textbox I want to display user name in next textbox when admin moves to next text box.for this I can use ajax
or javascript
? which one will be better?how can I do it through javascript.
相关问题
- Views base64 encoded blob in HTML with PHP
- Is there a limit to how many levels you can nest i
- Laravel Option Select - Default Issue
- How to toggle on Order in ReactJS
- Carriage Return (ASCII chr 13) is missing from tex
Better use Mootools, jQuery, YUI or any other js framework to perform Ajax requests. This will reduce your development time. For more info check apis of jQuery:
http://api.jquery.com/category/ajax/
The first step is to create a PHP script which will send parse-able data to JavaScript. Do not allow JavaScript to pass raw SQL queries to your PHP.
Then use JavaScript to fetch the values. The example below uses the MooTools library for simplicity's sake, but could be done with another library or in plain old regular JavaScript.