IER506 Posted July 21, 2010 Share Posted July 21, 2010 Good morning team. I'm a beginner in ajax and I've started reading tutorials for javascript/ajax/php and mysql scenarios from w3schools.org. I've managed to understand the philosophy of this technology but I have a really simple question! I've tried to run the following script: http://www.w3schools.com/PHP/php_ajax_database.asp and I've done it succesfully. But I was wondering how can I display the results when the page loads! I mean how can I have for example a value as default in my select option when the page loads for first time and display the appropriate results? Thanks in advance! Quote Link to comment Share on other sites More sharing options...
Nadiki Posted July 21, 2010 Share Posted July 21, 2010 add this on the body: onLoad="showUser(defaultValue)", where defaultValue is the value that you want to see in the page: like: ......................... </script> </head> <body onLoad="showUser(defaultValue)"> <form> <select name="users" onchange="showUser(this.value)"> <option value="">Select a person:</option> .................. sorry my english is very bad Quote Link to comment Share on other sites More sharing options...
IER506 Posted July 22, 2010 Author Share Posted July 22, 2010 Oh god...indeed it was so easy!!!! Thank you very much my friend!!!!! Quote Link to comment 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.