-
Update multiple text boxes values with one AJAX Call
I have a form which contains 1 drop down list abd 4 text boxes; the values for these boxes needs to be updated from the database based on the value from the drop down. Using the onreadystatechange you usually update the innerHTML to a div; how is it possible to update multiple values using the same method or is there other methods?
Thanks
-
How about grabbing the response text in one variable, then splitting that variable up into bits and then putting those bits into their respective text box.
PHP Code:
var someString = pageRequest.responseText;
...
var temp = someString.split(',');
text1.value = temp[0];
text2.value = temp[1];
text3.value = temp[2];
text4.value = temp[3];
The response text would've been something like:
thing1,thing2,thing3,thing4
Assuming you're using PHP you could use the implode function to add those strings together.
http://php.net/implode <-- Implode reference
Sorry if I'm way off, I've been using PHP and Javascript for some time but I haven't been using AJAX very long at all.
Similar Threads
-
By charligov in forum VB Classic
Replies: 2
Last Post: 01-22-2007, 12:00 PM
-
By MacataQ in forum VB Classic
Replies: 5
Last Post: 05-01-2005, 03:43 AM
-
Replies: 3
Last Post: 08-30-2001, 11:45 AM
-
Replies: 6
Last Post: 07-27-2001, 12:58 PM
-
By david in forum ASP.NET
Replies: 0
Last Post: 08-02-2000, 01:42 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|