I'm experiencing odd behavior after adding options to a select via ajax.
After adding the items to the select, I want to select one of the items in the list based on value.
I tried the following RIGHT after I called the function that adds the options to the select
fillSelect("someAjaxServerVar");
$("#theSelect").val("somevalue");
Od...
This is a problem I face while using jQuery within Firefox Jetpack. In my Jetpack code I'm dynamically creating some SELECT boxes with options and their
respective values:
...
listOfWords[i] = "<select id=clozefox_answer> <option
value=wrongAnswer>distractor</option>"
listOfWords[i] += "<option value=trueAnswer>" + currentWord +
"</opti...
Can I get from PHP a value back like the new id from the row I've just added to the database or should I make a SELECT to retrieve it?
<?php
$sql = "INSERT INTO my_table (column_1, column_2) VALUES ('hello', 'ciao')";
$res = mysql_query ($sql) or die (mysql_error ());
$sql = "SELECT column_id FROM my_table WHERE column_1 = 'hello'";
$...
Hi im a newbe to HQL and have a SQL expression I need converted but am unable to select the SQL statement is:
select SenseDate as Time,SenseValue as Value
from UserData
where NetworkID = '23'
and IODeviceID = '129'
and SenseDate >= DateAdd("d",-1, GETDATE())
and SenseDate<=GETDATE()
and can run this part in HQL without problems:
from...
Hi.
I have a large table (2,000,000 rows) and I'd like to print each record to the screen, one at time, without loading the entire table into memory.
//pseudo code
var cmd = new NpgSQLCommand();
cmd.CommandText = "SELECT * FROM mytable;"
IReader reader = cmd.ExecuteReader(); //blocks until the entire set is returned
while(reader.Read(...
Here is my run-of-the-mill drop down:
<select name="">
<option value="">--Select One--</option>
<option value="textarea">Text Area</option>
<option value="textbox">Text Box</option>
<option value="checkbox">Check Box</option>
<option value="dropdown">Drop Down</option>
</select>
What I want to do is show show/hide other elem...
I have a table "City" which contains city names, and I have a another table which I just created and contains cities from different sources. When I run a query to match the cities between the two tables I find about 5000 mismatches.
So please give some queries which I can use to match cities (because sometimes users enter city names wi...
I want to update data table for those who score exam id 1,2 more than 80. I try this
UPDATE data
SET
column = 'value'
WHERE
(SELECT * FROM exams
WHERE (id = '1' AND score >= 80) AND (id = '2' AND score >= 80));
It gives me 0 result. But it should have few hundreds results ANy help??
I think the problem is this:
SELECT * FROM exams
...
Hi, i'm developing a site that must be as accessible as possible. While assigning the accesskeys to my form fields with
widget=FieldWidget(attrs={'accesskey':'A'})
i found out that the w3c validator won't validate an xhtml strict page with an accesskey in a select tag. Anyway i couldn't find a way to assign an accesskey to the label rel...
I am trying to convert select boxes to radio buttons on the fly using jquery, and I'm not sure the best way.
Example HTML:
<form id="product">
<select name="data[123]">
<option value="1">First</option>
<option value="2">Second</option>
......
<option value="n">xxxxxx</option>
</select>
</form>
...
I want to tightly grasp the hair on the back of a Microsoft employee's head, using it as leverage to pound his head forcefully and repeatedly against a hard surface! That would make me feel nearly as good as solving this problem right now.
I've got a simple XML message that looks like this:
<?xml version="1.0" encoding="utf-8"?>
<mess...
Currently I am using jQuery to hide/show select options using following code.
$("#custcol7 option[value=" + sizeValue + "]").hide();
This works fine in Firefox, but doesnt do any good in other browsers. How to I hide options from select in Chrome, Opera and IE?
...
I have a select field that is dynamically populated with an ajax call that simply returns all the HTML select options. Here is the part of the PHP that just echo's the select tags and dynamically fills out each option/value.
echo "<select name='player1' class='affector'>";
echo "<option value='' selected>--".sizeof($start)." PLAYERS LO...
How do I select in a table like below all objects that have a-A and b-B (as key-value pair)?
Something like:
SELECT DISTINCT(OBJECT)
FROM MYTABLE
WHERE key = 'a'
AND value = 'A'
AND key = 'b'
AND value = 'B'
...where the result would be 1 and 3.
I know that this SQL statement doesn't work, but I hope it explains a b...
I am setting up a MySQL database and will be querying it with PHP. Is is better to break the information up into multiple tables and do select queries on each of the tables; or is it better to put all the items in one table and do a single select query?
For example:
It will hold information on upto 7 cars; which would mean that their ...
Possible duplicate: How to apply wildcard in instr() in MySQL?
The possible duplicate linked shows a query which is exactly like my current one sort of. However, I cannot find a way to make it a case sensitive match. :\
SELECT COUNT(*) FROM users WHERE INSTR(flags, 'T') > 0;
I get a count of 46 which is obviously wrong. It's counting...
Hi all,
In my way of learning drupal, I got stuck in this issue. I have Taxonomy vocabularies that I set as tree with each node have different depth. Now, I need to display it in select box in a way that only one select(the parent terms) at first. On change, it will fetch term's children and display another select box below it. This goe...
In looking up how to perform an equivalent to SELECT TOP 5 with LINQ-to-SQL, all the answers I've seen suggest using .Take(), like so:
var myObject = (
from myObjects in repository.GetAllMyObjects()
select myObject)
.Take(10);
I don't yet understand most of how LINQ works behind-the-scenes but to my understanding of C-like languages t...
This is probably a simple question, but I can't figure it out so I'm asking the community.
I have a select list and a text field in a form. They both have the same class.
I want to find a clean conditional statement that will allow me to disable a set of radio buttons in another part of the form if the text field is not empty AND some...
hi,
i have a table like this:
+------------------------+
|Key| value | name |
+---+-------+------------+
1 A john
2 B Mary
3 C Ben
4 A Ben
5 B john
6 C Mary
how can i do a select which returns who has values of "A" and "B" (in t...