Jump to content

Very easy ajax question (I think...)


IER506

Recommended Posts

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!

Link to comment
https://forums.phpfreaks.com/topic/208478-very-easy-ajax-question-i-think/
Share on other sites

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

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.