I have a small problem, I have setup a small admin panel for a simple site that connects to a database to get an ID, the ID is a random 5 characters generated automatically. now, in the admin area I have an option form.
<form action="#" method="post">
<select name="list" id="list" >
<option value="Please select an option<br>">Select Option</option>
<option value='<input type="text" name="linkaddr"/><input type="hidden" name="whattodo" value="addlink"/>'>Add new link to business</option>
<option value='<!--in here needs to show another form--><input type="hidden" name="whattodo" value="lookforid"/>'>Lookup ID</option>
<option value=''>Add a new Business</option>
<option value=''>Change Business information</option>
</select>
<br>
<span id="tag">Please select an option<BR></span>
</table>
<input type="submit" name="submit"/>
</form><script>
// Get references to the objects you need (<select> and <span>)
var list = document.getElementById('list');
var tag = document.getElementById('tag');
// When the list value changes, set the innerHTML of the <span>
list.onchange = function() {
tag.innerHTML = this.value;
};
</script>
this works fine, anything in a value of what option is selected is displayed, now for edit a business it needs to display a form next to it, in that form it will contain all of the businesses that are in the database and simple PHP and SQL will do that, I have that ready. what i need is if somebody were to select edit it would show them a drop down list of all businesses but if they were to select another thing it would show different options. i am in way over my head and do not know 100% what to do. if someone were to select "lookup ID" then it should show a list of all the companies in the database and then when you select that it must show the ID.
any help would be gratefully received, Cheers, Leon
Aucun commentaire:
Enregistrer un commentaire