kingasa
asked on
get info from DataBase onBlur event
Hi,
How can get info from a DataBase on an onBlur event of input text.
I do not want to post/get all of the page in order to perform this action.
Is it possible to post/get only 1 input text, so that only his value will change.
I do not want the user to notice that an http post/get was made.
Toda.
How can get info from a DataBase on an onBlur event of input text.
I do not want to post/get all of the page in order to perform this action.
Is it possible to post/get only 1 input text, so that only his value will change.
I do not want the user to notice that an http post/get was made.
Toda.
what I would do, even though you don't prefer this method, but it works, is onBlur, refresh the page, pass all of the text field values over and repopulate the page with them so it looks as if the page never changed, a call to the database will be made, and you can then populate the specific text box with the new information attained from the database. If you need a code example, let me know.
A page refresh on a slow connection is not going work like that the browser will look like it is hung unless you give the user an indication of what you are doing.
Cd&
Cd&
That is not true for all cases. It depends on the contents of your page and the size of your query, and how well the query is designed. I've used this method before and it works well. I don't know the type of content your page has though, so you'll have to make that decision.
kingasa, you can try this if you want a solution that works in older browser:
1) Make your page a frames. Top frame is your form, occupy all the space. Bottom frame is a hidden frame.
2) You bottom frame should be as simple as possible. It should contains a form that post to the server. The result will come back, formatted as a javascript object that contains the data you needed for the form in the Top frame.
3) When onBlur, fires the submit method of the bottom frame form.
4) The bottom frame's result page will contain a function that update the form elements in the top frame.
This is just a general idea of how to solve the problem. In additin to using frame, you can use a Java Applet, or even a Flash file to query the result. Also, in IE, you can use RDS to maintain a connection to the db, then you can use ADO to do all the database query, and then retrieve the result using JavaScript.
If you need detail instruction, let me know.
1) Make your page a frames. Top frame is your form, occupy all the space. Bottom frame is a hidden frame.
2) You bottom frame should be as simple as possible. It should contains a form that post to the server. The result will come back, formatted as a javascript object that contains the data you needed for the form in the Top frame.
3) When onBlur, fires the submit method of the bottom frame form.
4) The bottom frame's result page will contain a function that update the form elements in the top frame.
This is just a general idea of how to solve the problem. In additin to using frame, you can use a Java Applet, or even a Flash file to query the result. Also, in IE, you can use RDS to maintain a connection to the db, then you can use ADO to do all the database query, and then retrieve the result using JavaScript.
If you need detail instruction, let me know.
ASKER
kamcheungon
please do.
please do.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This article should give you a complete understanding of how to handel data changes in form, and get data from the DB on the server side
http://www.programmersresource.com/articles/listbox.asp
http://www.programmersresource.com/articles/listbox.asp
This article should give you a complete understanding of how to handel data changes in form, and get data from the DB on the server side
http://www.programmersresource.com/articles/listbox.asp
http://www.programmersresource.com/articles/listbox.asp
sorry guys, I dont know why it posted so many times...
I will delete comments not pertinent to the technical issue here. Have maintained a copy, if needed.
Moondancer
Community Support Moderator @ Experts Exchange
Moondancer
Community Support Moderator @ Experts Exchange
Completed.
Moondancer
Moderator @ Experts Exchange
Moondancer
Moderator @ Experts Exchange
The only way you wouldn't have to do that is if ALL the possible entries were downloaded to the client, and swapped into a form field where necessary.