views:

172

answers:

1

Hi, I am using application builder in oracle - and I have a create new record form for the opening times of a cinema.

Basically at the moment I have it so you can put ina cinema id from a cinema table, but the problem is whith that you need to know the id - so its not very user friendly. I would like this id to be dynamically be put in to the form somehow by slecting the cinema name from a dropdown (I have managed to include the cinema dropdown)

How can i populate the form with the respective id based upn the choice of the select box in application builder?

Thanks

A: 

Do you mean Oracle Application Express, which has a component called application builder?

A typical select list query would be:

select cinema_name, cinema_id
from cinemas
order by cinema_name;

That will display a list of cinema names to the user, and when the pick one populate the item value with the cinema ID. In HTML terms it constructs a SELECT tag like this:

<select id="P1_CINEMAS">
  <option value="11">Ashtead</option>
  <option value="23">Birmingham</option>
  <option value="72">Croydon</option>
</select>

If the user chooses "Croydon" from the above list, the value "72" will be posted to the database.

Tony Andrews