option

How do I check if no option is selected in a selectbox using jQuery?

I am trying to see if an option was selected in a selectbox and if not, I want it to alert a string. I was referring to this link(http://stackoverflow.com/questions/149573/check-if-option-is-selected-with-jquery-if-not-select-a-default), but its not working. Here's my code: <select id="language" name="language"> <option value=""></op...

How do I use Jquery to find and select a Multi Select option by the Value?

I can't seem to figure out how to correctly select a Multi Select option by the Value and leave the other options that are selected alone. Update It does work, thanks! I had the multi-select hidden and I thought firebug would update the option to "selected" but it doesn't. When I "show" the multi-select box after setting the attr to s...

How do I bring forward the SELECTED option in PHP from MySQL?

Hi all, In my update form, I want the fields to recall the values that are already stored. This is very simple in a text field, but for my drop down () I'm having trouble with PHP reading the already stored name of user. Here is my query and code: $sql = "SELECT users.user_id, users.name FROM users"; $result = mysql_que...

Using Option all over the place feels a bit awkward. Am I doing something wrong?

As a result of articles I read about the Option class which helps you avoid NullPointerException's, I started to use it all over the place. Imagine something like this: var file:Option[File] = None and later when I use it: val actualFile = file.getOrElse(new File("nonexisting")) if(actualFile.getName.equals("nonexisting")) { // inste...

jQuery remove selected option from this

Hi all, first post here, I come in peace :) I've searched but can't quite find what I'm after. I am trying to manipulate the selected option of a select box. Can someone please explain why this works: $('#some_select_box').click(function() { $('#some_select_box option:selected').remove(); }); but this doesn't: $('#some_select_box'...

TortoiseSVN trunk checkout "Server sent unexpected return value (403 Forbidden) in response to OPTIONS" error

First of all please excuse my lack of knowledge, I'm new to Tortoise, and my bad English. My problem is that every time I do some operation with an URL like the following one: https://nttt.dttt.com:8443/svn/nttt/Med/trunk I get "Server sent unexpected return value (403 Forbidden) in response to OPTIONS". The user and password I supplied...

Convert a List of Options to an Option of List using Scalaz

I want to transform a List[Option[T]] into a Option[List[T]]. The signature type of the function is def lo2ol[T](lo: List[Option[T]]): Option[List[T]] The expected behavior is to map a list that contains only Somes into a Some containing a list of the elements inside the elements Some's. On the other hand, if the input list has at lea...

Why does Option not extend the Iterable trait directly?

Option is implicitly convertible to an Iterable - but why does it not just just implement Iterable directly: def iterator = new Iterator[A] { var end = !isDefined def next() = { val n = if (end) throw new NoSuchElementException() else get end = true n } def hasNext = !end } EDIT: In fact it's even weider than that...

Populating a Dropdown list in PHP dynamically

Hi, I have a small PHP page which contains two drop down lists I need to populate the second one according to the result selected in the first drop down list .... is this possible? In other words I need to use the value selected from the first drop down list and use it in the dB query used to populate the second drop down list (but th...

Prototype set selected option based on other select

Hi, how can I "copy" the selected option between two s that have the same options using prototype ? I tried getting the selected option from the "master" combo using function getSelectedArea() { $$('#areacont1 option').find(function(ele){return !!ele.selected}) } which returns null And setting the second combo using var c2ROptions...

Best MBA Course After working as Software Developer for 3 year?

Hi, My background is engineering with Computer Science.I have been working as Software Developer for last 3 year. Now i want to do MBA. Can somebody suggest me what would be best combination among MBA with my background? Thanks. ...

Any way to access the type of a Scala Option declaration at runtime using reflection?

So, I have a Scala class that looks like this: class TestClass { var value: Option[Int] = None } and I'm tackling a problem where I have a String value and I want to coerce it into that Option[Int] at runtime using reflection. So, in another piece of code (that knows nothing about TestClass) I have some code like this: def setField...

How to tell Visual Studio 2010 to remember the position of the Find dialog?

When I press Ctrl+F, the Find dialog appears in adventurous positions. When more than a whole screen full of text is selected, it appears completely off the bottom of the screen except for its title bar. Needless to say, this is not helpful. A friend of mine, however, reports that the dialog is always in the same position for him and do...

DocumentFragment not appending in IE

I have a select list which, when changed, pulls data via ajax and dynamically creates select lists. Then based on the data used to create the select lists (a type), I pull more data via ajax if i don't have it already and create the options for the select list and store them in a fragment. Then I append that fragment to the select list...

HTML Select DropDown list with multiple colours

Hi, Is it possible to have different colours for different items in the dropdown list? Eg: Option 1 = green Option 2 = blue etc ...

How to hide optgroup/option elements?

Is there a way to hide option or optgroup HTML elements? I've tried calling hide() in jQuery, and also using regular Javascript to set style.display='none'. It works in Firefox but not in any other browsers. Actually removing them from the DOM does work, so perhaps there's a way to save each DOM element when it's removed, and reinsert t...

Form Validation - IF field is blank THEN automatically selection option

Hi I need help to automatically select an option to submit with a form: When the 'form-email' field is blank i want it to select 'option 1' and, When the field is not blank i want it to select 'option 2'. Here's my form code <form method="post" onsubmit="return validate-category(this)" action="tdomf-form-post.php" id='tdomf_form1' na...

Selected option in view when SIZE is greater than 1

How do you get the selected option to be in view on page load? <select name="whatever" size="5"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7" selected>7</opti...

How to select first empty value option in a select menu?

The following always preselects the last option, even when I set the selected attribute, but I like the first option to be preselected. <select name="filter"> <option value="" selected>Make a choice</option> <option value="1">1</option> <option value="3">3</option> <option value="7">7</option> <option value="">all</o...

how to get option title="sample" using jquery

Hi, I'm trying to update a hidden field based on the a title attribute on a select option, I've tried the code bellow and can't seem to get it to work. Thanks for any help! <form> <select id="selectbox"> <option name="test" value="one" title="title" selected="selected">one</option> <option name="test2" value="two" title="title2">two</op...