select

In an HTML form, I need to generate incrementally increasing values in the dropdown options of a select tag.

Here's what I need to write for a bunch of dropdown menus: <select> <option value="23">23</option> <option value="23.5">23.5</option> <option value="24">24</option> <option value="24.5">24.5</option> [etc...] </select> It needs to increase by .5 for every option. The etc. part is where I need to repeat the process...

How to select the grandparent of a node using xslt

I'm in a situation where I can only test for the child node, but I have to apply tags to the grandparent of this child node. I've tried using: <xsl:call-template name="grandparent" select="parent::parent::node()"/> and: <xsl:call-template name="grandparent" select="ancestor::node [@nameofgrandparentnode]"/> But neither works. Th...

jQuery; detecting if a select box has changed or is selected

I have a process in place which detects if a select box is changed, if it does get changed, the content in a div reloads. I've realised that when the form is submitted and has errors, the select box should have the option selected prior to submit, selected. If this is the case, the div needs to reload with the correct content. My curre...

Re-index a series of hidden fields and a select box

Hi, I'm working on a small project at the moment and have a requirement to re-name/re-index some fields, display items. Initially, the user is presented with a drop-down with an option to add a new item. If the user adds a new item it will append a new option to select box and give the option a new value (The value of the previous item...

Jquery Select element 2 positions further - another way to .next().next()

Hey, I am searching for a way how I could select a div element which is not the direct next one to the one which is "selected" by a click function. <div id="click">(siblings)</div><div>text</div><div id="get this one"></div> Now i would like to select the one with the id "get this one" - in my code this id is not available. All the ...

sql search query still not producing expected results.

I need a count and search query to work properly. The count query appears to be working properly, however the search query is not. Count query: SELECT COUNT(DISTINCT tg_id) FROM tg_keywords WHERE tg_keyword LIKE 'keyword_1' OR tg_keyword LIKE 'keyword_2' ORDER BY tg_keyword LIKE 'keyword_1' AND tg_keyword LIKE 'keyword_2 DESC Re...

How to call a function dynamically

I have in vb a selector Dim ver =101 Select Case ver Case 101 upd101() Case 102 upd102() Case 103 upd103() End Select How can I make this select better by calling function in more dynamically in this form: with the prefix "upd" followed by a ver integer..? thank you! A...

Mysql: Best practice to get last records

Hi there ! I got a spicy question about mysql... The idea here is to select the n last records from a table, filtering by a property, (possibly from another table). That simple. At this point you wanna reply : let n = 10 SELECT * FROM huge_table JOIN another_table ON another_table.id = huge_table.another_table_id AN...

jQuery wait for above code execution to complete

I've written some javascript using jQuery to replace any select lists with a div and ul alternative so that it will give me some more styling control and make the drop downs look the same cross browser. The below code works 99% for me but I have one issue. At the bottom of the code I have had to use .delay() to tell the code in a way to ...

SQL select with hierarchy for default values

I have a table in the following format: +---+---+--------+ | u | i | value | +---+---+--------+ | 0 | 1 | Value1 | | 0 | 2 | Value2 | | 0 | 3 | Value3 | | 8 | 2 | Value4 | | 9 | 2 | Value5 | | 9 | 3 | Value6 | +---+---+--------+ My goal is to do a select that selects values from that user (u) for each id (i) if it exists, if not f...

Can I eager load a property using HQL?

I'm trying to work out how to eager load the customers in the following HQL query: select order.Customer from Order as order where order.Id in ( select itemId from BadItem as badItem where (badItemType = :itemType) and (badItem.Date >= :yesterday) ) There's the usual many-to-one relationship between orders and customers. I'd li...

xslt select grandparent node depending on an attribute value of its grandchild node

I'm trying to add different tags to a node depending on an attribute value of its grandchild node. Sample Input (a 1x3 table): <table> <row> <cell row="1" column="1" >heading text one</cell> </row> <row> <cell row="2" column="1" >body text one</cell> </row> <row> <cell row="3" column="1" >bo...

MySQL: Limit a query to 10 rows where every index has 5 tags.

Hi, I'd like to make a query where I can retrieve an interval of 10 rows with 5 tags per each one. I have houses and tags table, I know how to do it only for simple queries with a SELECT using LIMIT but how can I do it in this case? table houses id house country 1 Grunt Mansion us 2 Hororo Suneku jp 3 Ca...

Select value of one field into another on the same MySQL table in from the same row?

If I were to translate my MySQL table into PHP it might look something like this: $table = array(); $table[0] = array ('id'=>0, 'f1'=>0, 'f2'=>1); $table[1] = array ('id'=>1, 'f1'=>0, 'f2'=>2); // etc... In that case, I would want to do something like this: foreach($table as $row) { $row['f1'] = $row['f2']; } Is it possible to ...

Select adjacent records in Mysql

Assuming this table is ordered by date id | date | customer 3 | 2009-10-01| Frank 1 | 2010-10-11| Bob 4 | 2010-11-01| Mitchel 2 | 2010-11-02| Jim I would like to make a query so that knowing ID = 4 the resulting rows are $row[0]['id'] == 1 //previous $row[1]['id'] == 4 //most recent/current $row[2]['...

IE select issue with hover

A friend and myself are trying to workaround IE (7/8). We have built a canonical example here: http://www.mathgladiator.com/share/ie-select-bug-hover-css-menus.htm Using a CSS menu, we would like to have selects in them. However, in IE, the menu goes away when you interact with the select box. We believe this has to do with a bug in ho...

MySQL: Which indexes to use for a simple range select?

Hello, I have a table with ~30 million rows ( and growing! ) and currently i have some problems with a simple range select. The query, looks like this one: SELECT SUM( CEIL( dlvSize / 100 ) ) as numItems FROM log WHERE timeLogged BETWEEN 1000000 AND 2000000 AND user = 'example'</pre> It takes minutes to finish and i think that the s...

JQuery To Duplicate Form Select Menu Selection

I have a simple form with 2 pull-down menus. What I can't figure out how to do is have a simple HTML link that will copy the selection from the first select menu to the second. The one caveat is that we don't set 'id' on our form input fields so I need the JQuery object selection to be done using the 'name' field instead. Here is the HTM...

Select three rows when two of them need to be unique (SQL)

First of all I am using Oracle 10g Express So there are three columns I want to select: [domain_name] [index_path] [collection_name] Now there are two columns that I want to be unique: [domain_name] [index_path] So my issue is how do I basically: select unique domain_name, index_path from TABLENAMEHERE while also selecting the c...

Deadlock caused by SELECT JOIN statement with SQL Server

When executing a SELECT statement with a JOIN of two tables SQL Server seems to lock both tables of the statement individually. For example by a query like this: SELECT ... FROM table1 LEFT JOIN table2 ON table1.id = table2.id WHERE ... I found out that the order of the locks depends on the WHERE condition. The que...