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
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.
Related
I have a page that shows a list of students. I want to use a dropdown to implement a filter. When option 1 (high school students) is selected shows only high school students, when option 2 is selected (college students) is selected shows only college students and so on.
The query will be:
SELECT firstName, lastName, age
FROM students
WHERE studentCategory = #dropDownValue#
Is there any way to do this without using javascript nor any submit button. I am trying to pass the dropdown value to the URL but I am not sure how to change the URL when an option is selected from dropdown.
I appreciate any help.
To answer your question, you add onChange to the first SELECT.
<select
name="doesntmatter"
onChange="document.location.href='?studentCategory='+this.value;">
However consider using ajax as it will be much faster.
I am trying to set the selected value of a select control based on a model in an indexed situation. I have the following code -
<select asp-for="Items.Details[i].One"
asp-items="Utility.DropdownListItems(date, Model.Items.Details[i].One)">
</select>
I am setting the selected item in the Utility that returns the SelectList, and would expect that to set the selected item of the drop down, but that doesn't work. If I inspect the option elements, none have the selected tag.
I know there was an issue with indexed data in previous iterations of Mvc HtmlHelpers. Does anyone know if this was resolved in MVC6?
For both HTML and tag helpers, generated <option> elements are selected based on the expression value (Item.Details[i].One in your case). IsSelected from the select list matters only if the expression value is null i.e. in the Create case.
We have corrected a number of issues related to indexed data in MVC 6. Please file an issue at https://github.com/aspnet/Mvc/issues if something is still not working.
I have a newsletter sign up form on my website that presents the user with a list of checkboxes to select. The checkboxes are generated dynamically from my database. Other standards newsletter sign up fields, such as email, name, phone number, address, etc. exist in the sign up form, as well.
In MailChimp, I have created a List and have added custom fields to match my sign up form (e.g. phone number, address). I then looked at the Embedded Forms -> Naked to see the generated markup. It's easy enough to set the name attributes of the text fields on my sign up form to match those in MailChimp's.
The struggle for me now is the checkboxes. I cannot put the list of items for the checkboxes in MailChimp as they need to be dynamically generated from my database. I have added a checkbox field in MailChimp to see what name attribute it generates in hopes I could use it in my form; I see something like this:
<input id="mce-group[15757]-15757-0" name="group[15757][1]" type="checkbox" value="1">
In my sign up form, I tried something like this:
<input name="group[15757][]" type="checkbox" value="Apple">
When I signed up, "Apple" was not carried over.
How do I capture checkbox items from my signup form into MailChimp?
It looks like you're using interests -- you won't be able to pass custom values to those, as they are simply yes or no. You'd probably be better off using a merge field. Alternately, you can create the interests dynamically, but you'll need to write a script to do that, you won't be able to use the form builder directly.
I have a list of items in a dropdownlist. Each item contains 3 properties. The name, the acronym, and the Id. I'm currently using the name and Id which works perfectly fine.
As the list is long, it's typical for a user to open the dropdownlist and start typing to find the item they are after. Our users like to search/type the acronym, not the full name. So because we only show the full name in the dropdown text, typing the acronym usually does not get you to the correct item.
How can I display the full name, but type-ahead on the acronym?
Here's the dropdown, pretty standard.
<select kendo-drop-down-list style="width: 500px"
class="ade-header-organization-list"
k-data-text-field="'organizationName'"
k-data-value-field="'organizationId'"
ng-model="orgSelection"
k-data-source="orgData">
</select>
The data looks like this (on a per record basis):
{ organizationId: 1,
organizationName: "Society of Kelvin-based Athletes in Tundra Environments",
orgAcronym: "SKATE"
}
I want to be able to typeahead the word "SKATE" and have it jump to the correct item.
Note that I'm using angular here, but the behavior isn't angular specific.
I haven't been able to find a solution for the particular problem I'm having with this project. I need to the following: dynamically add rows to a table that contain two select boxes AND use ajax to auto-populate the select options of the 2nd select box, based on the value of the first select box... in the respective table row (that was dynamically added on the fly by some js).
Still with me?
I can easily populate, dynamically, a select drop-down using ajax/javascript based on the value of the first drop-down, in the first row. I can even populate three or more select boxes in the same row, using ajax/js functions to load each additional select. Yet, this is not my goal.
Here's what I have... My form contains a simple table with 3 columns. First is a checkbox, the second is the "State" select box and the third column is the "City" select box. I have two buttons above the table that allow me to "Add Row" and "Delete Row". Mind you, the first row (which is programmed-in), works perfectly for loading the city names of a state using ajax.
Upon clicking the Add Row button, I'm able to create the second row dynamically, which contains the checkbox, state select and city select fields. The state select is populated based on the innerHTML content of the original column, but the city select is obviously null because it is expecting ajax to fill it. Note: the names and ID names of these fields are iterative... city_id, city_id_1, city_id_2, city_id_3 and so on... so I have that uniqueness to work with.
My problem lies in the fact that when I select a state from the 2nd or 3rd (and so on) rows, only the firstcity select changes. Why? Because the js/ajax processing function says to operate only on the element with name "city_id"!! Which is the name of the city select box in the first row.
I have not (yet) found a way to dynamically pass the name of the element I need updated to the onreadystate ajax function. When I've needed to populate two or three select boxes in a row (same row), I've had to have complementary ajax functions for each drop-down - which are static, mind you... but what if I create the element dynamically?? I can't pre-program that many functions into my page... or must I?
If you have any ideas on how to accomplish this I would be soo damn appreciative!!!
Thanks!
var i=1; // put here the number of the column being added now.
var x=document.getElementById("city_id_"+i);
// populate x