select

Rails collection_select

Manager :has_many :interns, :through => :assigns Intern :has_many :managers, :through => :assigns I am trying to create a new assign record. This is the assigns/new view where a given authenticated intern is creating a new association with a manager: # assigns/new.html.erb <% form_for @assign, :url => {:action => "create"} do |p| %> ...

SQL Server OLE DB - select data from DB using RowSet

Hi, I want to ask how to select data from DB using OLE DB CRowSet in C++. How to access specific row, specific column etc. like in ADO .NET using DataTable. Can you give me some tutorial please? Thanks ...

How to select a partial object including a list with new() syntax in Hibernate

In my Hibernated system, I have a class Picture that has some simple data, a list of Installations and some (huge) binary data. The list of Installations is implemented with a join table, as it's a ManyToMany relation, and it's defined on the Installation side: @Entity public class Picture { @Id private long pictureId; private Str...

MYSQL get other table data in a join

Hello, I am currently running this SQL SELECT jm_recipe.name, jm_recipe.slug FROM jm_recipe LEFT JOIN jm_category_recipe ON jm_category_recipe.recipe_id = jm_recipe.id WHERE jm_category_recipe.category_id = $cat" This returns the desired results except that I also need to return the name of the category that the recipe I am looking ...

Getting options text value in Java

How I can get select option text value in Java? Select options are in javascript. <select id="colors" name="colorselector" > <option value="red"> Red </option> <option value="blue"> Blue </option> <option value="orange"> Orange </option> <option value="blue"> Yellow </option> </select> ...

Can a user select and upload more than one file at a time in asp.net?

I made a website for a friend and he uploads a lot of pictures, around 20k per month. And sadly, I made it so he has to upload 1 at a time, because when they are uploaded they are renamed, attached to a group id and watermarked. Is there a way to allow him to select all 20 in a group and have them be uploaded and processed? I've looked...

Rails: Using named_scope which triggers a MySQL "in"

PROBLEM: I want to run a query which would trigger something like select * from users where code in (1,2,4); using a named_scope. WHAT I TRIED: This is for a single code: named_scope :of_code, lambda {|code| {:conditions => ["code = ?", code]}} I tried something like named_scope :of_codes, lambda {|codes| {:conditions => ...

jQuery - Select EVERY UL of last LI in list

Hello, I'm trying to format my list of items, where the html goes like this: <ul class='product_list'> <li>Item 1 <ul> <li>Item 1.1</li> <li>Item 1.2 <ul> <li>Item 1.2.1</li> <li>Item 1.2.2 <ul> <li>Item 1.2.2.1</li> ...

Change DB link Names Dynamically in a Select

Good Morning everyone.. I have several DB links defined and would like to be able to dynamically change which link I want to use depending on the a user input. Is there a way? Example: select * from parts@dblink I am looking for a way to use a variable and have users input the link pointing to a particular database. Is this possible?...

How can I create a simple Select for a self referential table?

For example, I have this table: CREATE TABLE perarea ( id_area INT primary key, nombre VARCHAR2(200), id_areapadre INT references perarea(id_area) ); Instead of showing: 1 IT null 2 Recursos Humanos null 3 Contabilidad 2 4 Legal 2 I want: 1 IT 2 Recursos Humanos 3 Contabilidad Recursos Humanos 4 Leg...

JavaScript - Sort SELECT options

Using PHP, I scan a directory and list all of the .xml files. Each XML file contains both a "name" element and a "date" element. The "name" element for each XML file is listed as an option in the select list. This works perfectly fine, however, the "date" element in each XML file is different and contains a date format like this: mm/dd...

From tabindex include <selects>

Is it possible to tab to a <select> element? I am creating a rather intensive form that would greatly benefit from being able to tab through everything not just the text fields. <input type="text" name="date" value="00/00/0000" tabindex="1" /> <select name="hour" tabindex="2"> <option value="1">01</option> <!-- Blah more --> </s...

dynamically adding sets of form elements n times

i'm working on an application that lets users enter the opening hours for a restaurant. i have the form code set up like this: <div class="hourswrapper"> Days: <input type="checkbox" name="day1[]" value="1" />M <input type="checkbox" name="day1[]" value="2" />Tu <input type="checkbox" name...

Prototype library component for the select box options

Hi folks, An UI question... There are two select boxes between which there are two buttons "<<" and ">>". When you hit the "<<" button the selected items from the select item on the right moves to the left and similarly from left to right ">>". I am not sure what this kind of set up is called in terms of or jargon or terminology ;) I ...

JQuery: Hide options of select according to option value

Dear readers, given following html <select name="IBE1$IBE_NurFlug1$ddl_Abflughafen" id="IBE1_IBE_NurFlug1_ddl_Abflughafen" class="dropdownlist" style="width: 99%;"> <option value="Antalya;TR">Antalya</option> <option value="Berlin;DE">Berlin</option> <option value="Duesseldorf;DE">Duesseldorf</option> <option value="Frankfurt;DE">Frank...

How to select most populated record?

I have the unfortunate luck of having to deal with a db that contains duplicates of particular records, I am looking for a quick way to say "get the most populated record and update the duplicates to match it". From there I can select distinct records and get a useful set of records. Any ideas? It's mainly names and addresses if that ...

SQL Server - selecting a row doesn't return any NULL values. Why?

Hi. I've got the following SQL table: CREATE TABLE [dbo].[Test]( [TestID] [int] NOT NULL, [TestNum] [int] NULL, [TestReason] [varchar](50) NULL ) So TestNum an INT which allows NULL values, and I've inserted a whole lot of data into the table, of which some of the rows contain a NULL value for TestNum If I then run the fo...

How do I order a SELECT on a column's character length?

I want to select * from tbl order by characters, for example: a) 1 coloum has a b) 1 coluum has ab I want it to place ab first and then a ...

In python, when using select.select on socket objects, how should I handle sockets that end up on the error list?

read, write, error = select.select(sockets, sockets, sockets, 60.0) What is recommended if something ends up in the error list? ...

How to get Javascript Select box's selected text

This things works perfectly <select name="selectbox" onchange="alert(this.value)> But I want to select the text. I tried in this way <select name="selectbox" onchange="alert(this.text)> It shows undefined. I found how to use dom to get text. But I want to do this in this way, I means like using just this.value. ...