ok ok
What i wanted was an onChange option, this then calls a javascript procedure
But i need the procedure to be php with embedded html
Like mentioned, JavaScript is client side (runs on the browser) and PHP is server side (runs on the server).
Regarding: "php with embedded html".
I believe you mean PHP embeded in HTML. This is a confusing statement that "sells" PHP when you are new to the language. It doesn't mean that PHP is embedded in HTML some how literally speaking. All php is processed on the server and only HTML is sent to the browser. It just means that you can seperate PHP in <?PHP ?> tags and place this in between your HTML.
So in order to use PHP, you'll have to make a request to the server, as mentioned with a form POST, or a GET request.
This equates to a new page load on the browser. Or a refreshing of a hidden Iframe or use of AJAX if you dont want to reload the page.
I believe what you want is simple a new page load, as that is the simplest and most conventional.
If you want to make a GET request using JavaScript, you can use:
window.location = 'http://example.com';
If you need to submit a form automatically, use form.submit(); where "form" is the form object defined in the DOM.
Exaple: make a HTTP GET on selecting a new option.
[HTML]<select name="selectbox" id="selectbox">
<option value="">Select a Page</option>
<option value="http://example.com/page1.php">Page 1</option>
<option value="http://example.com/page2.php">Page 2</option>
</select>
<script type="text/javascript">
var select = document.getElementById('selectbox');
select.onchange = function() {
window.location = select.options[select.selectedIndex].value;
}
</script>[/HTML]