select

How do I programmatically change a select so that it fires its onchange behavior?

This doesn't seem to be working: <select id="mySel" onchange="alert('foo')"> <option value="a">a</option> <option value="b">b</option> </select> <script> dojo.byId('mySel').value = 'b'; // select changes, but nothing is alerted </script> (I'm using dojo, but that doesn't really matter.) ...

PHP/MySQL / Use String to SELECT from Database

Hi all, I have a string: $string = "12,15,22"; Each of these values represents a usrID and I'd like to use these to select the rows associated with the $string. Something like this: SELECT usrFirst, usrLast FROM tblusers WHERE usrID = 12 OR 15 OR 22. Now, the $string changes all the time, and sometimes can be a different number...

Disable keyboard in HTML SELECT tag

I want to disable the keyboard for an HTML SELECT tag so the user can only use a mouse to select the options. I've tried event.cancelBubble=true on the onkeydown, onkeyup and onkeypress events with no luck. Any ideas? ...

Mysql "order of operations" Question

Hi all, Here's my situation: I want to SELECT all entries from a database WHERE id = $id. But I want the results to be listed in a certain priority. If, criteria = $criteria, then I want those results displayed first. Otherwise, I just want to keep displaying the rest of the rows. My question is this: will this solve my problem?...

Tree-like Select in HTML

I'm trying to create a tree-like <select> using HTML and CSS. To maintain accessibility I'd like to avoid javascript if possible. I'd also like to avoid using &nbsp; instead of padding, as this prevents pressing letter keys to jump to items. What I have so far is this: <select> <optgroup label="fluffy" style="padding-left: 10px;">...

SQL Selecting finished orders with multiple operations

I have a list of orders with suboperations. How can I create a list of finished orders? Finished order must have finished all suboperations. Table "orders": order_no | suboperation | finished 1 | preparing | 01/01/2009 1 | scrubbing | 01/05/2009 1 | painting | 01/10/2009 2 | preparing | 02/05/09...

How to handle multiple one->many relationships?

I have a database with several tables, 5 of which are dedicated to specific publication types. Each of these 5 have a one->many relationship with a status table and a people table. All of these tables are tied together using a unique "pubid". I have a view which includes the pubid (for all 5 types), along with their associated keyword...

implementing select and deselect (toggle) on a SELECT TAG

The current HTML SELECT tag works great for me except for one thing. Is it possible to implement toggling on the current item. If I have a current selection, I'd like to click it again and "de-select" it. It doesn't work that way now, it simply keeps the current selection "selected". It seems that I need to know the "previous" sele...

Problem with select() call

I created two sockets udp_S, tcp_S (one each for UDP AND TCP).Now I want to wait on select() call until there is any data sent from any UDP client or there is any request for coonection by a TCP client. Here is a brief snippet of my code: int udp_S,tcp_S; /*Create sockets using socket()*/ /*Bind address to them using bind()*/ fd_set ...

Select Random record and Update same record in one Query?

I'm working on a small banner-rotation script that loads a random banner from the database. I am tracking impressions in the database and would like to know if I can select a random record and update its impression-value in a single query, or would I need to select a random record, and then update based upon the record pk. Using MySQL. ...

rails: fields_for select

In a view that I have, I am using fields_for to display form data for a relational table. However, part of this form will have select lists to choose from. I see there are label, text_field, text_area helpers for the form_for and fields_for helpers that will fill in the info needed from an already populated model object... but what abo...

Why doesn't my <select> work in IE8?

So I have a <select> element on my page, and it worked fine in all browsers until IE8 came along. I've seen all the literature about the IE7 compatibility view and how to use <meta> to force the browser into that mode. But the question still remains: why the heck does IE8 fail to display a simple <select> properly? Has anyone figured thi...

Select from sql in condition that a certain column is start with a certain string.

I am using sql. How to select all items from a table. where a column (varchar) path is start with a certain string : "stringABC" select * from ATable where path like 'stringABC'; The above sql is wrong, can any one help me to fix it? Many thanks! ...

Make radio buttons

Hi guys! Sorry for this question, but is it possible to make radio buttons instead of select list from this piece of code? function _nodereview_form_review(&$form, $axis, $node) { static $options; if (!isset($options)) { $options = array( 20 => -2, 40 => -1, 60 => 0, 80 => 1, 100 => 2, ); } $form['reviews'][$axis->aid...

DB generated list not working when created using jquery.

I have a simple form that has a list (dropdown list generated from a DB), when a user makes a selection, the selection is printed on the screen. The problem I'm having is that if I use jquery to call the php funciton that generates the list when the page is loading, the list will not work, but if I add the code directly in the html it wi...

Selecting text on focus using jQuery not working in Safari and Chrome

I have the following jQuery code (similar to this question) that works in Firefox and IE, but fails (no errors, just doesn't work) in Chrome and Safari. Any ideas for a workaround? $("#souper_fancy").focus(function() { $(this).select() }); ...

Why doesn't locking a cell in a protected worksheet in Excel prevent selection?

I'm working on a protected Excel spreadsheet and ran into a problem with cells that I've programmatically locked that are still selectable. I can't click on them directly to select them, but if I select the cell to the lower right of a locked cell and then shift-click the one to the upper left, all 9 cells (including the 'locked' one) a...

Zend Framework Db Select Join table help

I have this query: SELECT g.title, g.asin, g.platform_id, r.rank FROM games g INNER JOIN ranks r ON ( g.id = r.game_id ) ORDER BY r.rank DESC LIMIT 5` Now, this is my JOIN using Zend_Db_Select but it gives me array error $query = $this->select(); $query->from(array('g' => 'games'), array()); $query->j...

Hide options in a select list using jQuery

I have an object with key/value pairs of options I want to hide/remove from a select list. Neither of the following option selectors work. What am I missing? $.each(results['hide'], function(name, title) { $("#edit-field-service-sub-cat-value option[value=title]").hide(); $("#edit-field-service-sub-cat-value option[@valu...

How would I save various selected options on an ASP.NET form to SQL Server to be recalled as a "saved" report?

I have an ASP.NET WebForm with a number of DropDownLists, multiple select enabled ListBoxes, CheckBoxes and TextBoxes. What I would like to be able to do is allow the user to save all the selected options and call it a name as a saved report. This would then allow them to click to retrieve the selections they made when they come back to...