I have a dynamic drop down that reads fields from the database.
I want a page to be opened in a new tab/window (target = _blank) when a user clicks on an item in the drop down.
How do I achieve that in PHP+Javascript?
My drop down
Expand|Select|Wrap|Line Numbers
- <select name = "sltStation">
- <option value="0">Select Station</option>
- <?
- $sql = "SELECT * FROM stations ORDER BY Name ASC";
- $result = dbQuery($sql);
- if(dbNumRows($result))
- {
- while($row = dbFetchAssoc($result))
- {
- echo "<option>$row[Name]</option>";
- }
- }
- else
- {
- echo "<option>No Stations present</option>";
- }
- ?>
id, Name and Link (a hyperlink)
I want to display the Name in the drop down and require that when a user selects a name (onChange), it opens the associated link in a new page-meaning control stays at the current page
ie Click on name, open associated link
I hope I'm clear
Will appreciate yur help