w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
MySQL: DROP a column with a question mark sign?
Use backticks to escape column or tables names with special names or names of reserved keywords in MySQL. And use the column keyword: ALTER TABLE player DROP column `is_playing?`;

Categories : Mysql

jQuery to automatically pre-select multiple options from several drop down lists based on user selection from another drop down list
The easiest way that comes to mind is the following: var positions = { QB : ['SPD', 'AGI', 'INJ', 'AWR', 'TPOW', 'ELUS', 'TACC', 'TDEP'], HB : ['SPD', 'AGI', 'ACC', 'AWR', 'CARY', 'TRCK', 'ELUS', 'BCV'], FB : ['SPD', 'AGI', 'AWR', 'TRCK', 'CTCH', 'RBST', 'RBFT', 'IMPB'] // fill in the rest of this object yourself } $('#position').change(function(){ // caching the selected value: var v = this.value, // retrieving the array stored under the relevant key: arr = positions[v], // getting all the select elements whose 'id' starts with the string: attribs = $('select[id^="attribute_type_"]'); // iterating each of those selects: $.each(attribs, function(i,v){ /* finding the 'option' whose value is equal to that stored in

Categories : Jquery

I want to show data from one column of mysql table in a drop down list,But in drop down it show every entry two times.But i want it only one time
your suolution : no need of for each... while ($row = mysql_fetch_assoc($result)) { echo '<option value="' . $row['customer_id'] . '"> ' . $row['customer_name'] . '</option>'; }

Categories : PHP

iOS UITableview simple drop down within table
TLIndexPathTools has extensions for both collapsable sections and expandable tree view. Try running the Collapse and Outline sample projects. If I understand your question, you've got a two-level hierarchy, so either of these extensions should work. The main difference between the two is that, with collapsable sections, the top level is done with section headers while the tree view is all done with cells. Also, collapsable sections has scroll optimization, such that when you expand a section, it automatically scrolls to display as much as the section as possible (though scroll optimization will be added to the tree view at some point).

Categories : IOS

Simple drag and drop code
Here's a jsfiddle with it working: http://jsfiddle.net/fpb7j/1/ There were 2 main issues, first being the use of onmousedown, onmousemove and onmouseup. I believe those are only to be used with attached events: document.body.attachEvent('onmousemove',drag); while mousedown, mousemove and mouseup are for event listeners: document.body.addEventListener('mousemove',drag); The second issue was the do-while loop in the move event function. That function's being called every time the mouse moves a pixel, so the loop isn't needed: var ele = document.getElementsByClassName ("target")[0]; ele.addEventListener ("mousedown" , eleMouseDown , false); function eleMouseDown () { stateMouseDown = true; document.addEventListener ("mousemove" , eleMouseMove , false); } function eleMouseMov

Categories : Javascript

Simple drag and drop in windows phone 8
Have you tried the MouseDragElementBehavior in Microsoft.Expression.Interactions assembly. It allows you to drag an object around and you can constrain it to be dragged inside its parent which might be a canvas. The xaml looks like this: <Image Height="110" Name="image1" Stretch="Fill" Source="/Assets/Tiles/IconicTileMediumLarge.png" Margin="254,90,95,407" MouseMove="MouseMoving"> <i:Interaction.Behaviors> <el:MouseDragElementBehavior ConstrainToParentBounds="True"/> </i:Interaction.Behaviors> </Image>

Categories : Image

How to Create simple drag and Drop in angularjs
I just posted this to my brand spanking new blog: http://jasonturim.wordpress.com/2013/09/01/angularjs-drag-and-drop/ Code here: https://github.com/logicbomb/lvlDragDrop Demo here: http://logicbomb.github.io/ng-directives/drag-drop.html Here are the directives these rely on a UUID service which I've included below: var module = angular.module("lvl.directives.dragdrop", ['lvl.services']); module.directive('lvlDraggable', ['$rootScope', 'uuid', function($rootScope, uuid) { return { restrict: 'A', link: function(scope, el, attrs, controller) { console.log("linking draggable element"); angular.element(el).attr("draggable", "true"); var id = attrs.id; if (!attrs.id) { id =

Categories : Javascript

Why does this simple drag and drop code cause the element to flicker?
Your math seems very strange. What exactly is the point of the diff variable? Don't you just want: ? ele.css('top', e.pageY); or ele.css('top', e.pageY - ele.height() / 2);

Categories : Javascript

A combo-box providing a resizable file name completion list and drop-down list with a history
Solution for WPF Part 1 Principle, you can use styles and templates for the implementation of your question. In the ComboBox the result is given in the Popup, but default it does not support changing the size. Add resizing is not difficult, if you use event DragDelta. Example: private void MyThumb_DragDelta(object sender, DragDeltaEventArgs e) { double yadjust = MyPopup.Height + e.VerticalChange; double xadjust = MyPopup.Width + e.HorizontalChange; if ((xadjust >= 0) && (yadjust >= 0)) { MyPopup.Width = xadjust; MyPopup.Height = yadjust; } } The event is better to set on the Thumb control (He also has events DragStarted, DragCompleted). It's all very well, but we do need to do inside the ComboBox. One way is to use the S

Categories : Wpf

How to make a jQuery UI droppable list where elements added to the list are also drop targets
I think what you really want is a sortable for the users list and then all the draggable for the "eligible items" jQuery(function($) { $('#list2 li').draggable({ cursor: 'move', helper: 'clone', connectToSortable: "#list1", }); $('#list1').sortable({ revert: true, }); }); http://jsfiddle.net/petersendidit/gKtXa/5/

Categories : Javascript

I need a drop down list to display a list of active cases, but I keep getting an error when there is more than one returned
You should try add the following in your query: masterCaseList.DataSource = MasterCasesBLL.GetAllMasterCases(false) .Where(x => x.MainContact != null && x.MainContact.MainContact == true) .Select(x => new { MainContact = x.MainContact.MainContactLabel, index = x.ID }) .ToList(); It appears that you have a null reference when the ToList method force the iteration.

Categories : C#

Dynamic drop down list - SelectedValue which is invalid because it does not exist in the list of items
You have set the SelectedValue to -1 which must exist. Don't confuse it with the SelectedIndex where -1 indicates that nothing should be selected. So i assume that you actually want: ' ... modelDD.Items.Clear() modelDD.SelectedIndex = -1 ' instead of SelectedValue = -1 ' ...

Categories : Asp Net

Create Drop down list as value list dynamically in Access 2010
What you're trying is pretty logical but you need to use the combobox's AddItem method. Private Sub Form_Load() Me.FNMARemittanceType.RowSourceType = "Value List" If Not Me.InvestorName = "Freddie Mac" Then Form_frmPatronInvestorGroupDetails.FNMARemittanceType.AddItem("Actual/Actual") Form_frmPatronInvestorGroupDetails.FNMARemittanceType.AddItem("Scheduled/Scheduled") Else Form_frmPatronInvestorGroupDetails.FNMARemittanceType.AddItem("Gold") Form_frmPatronInvestorGroupDetails.FNMARemittanceType.AddItem("First Tuesday") End If End Sub

Categories : Vba

Jtable options array for drop down list or select list
After much trial and error, and debugger stops in the jtable scripting files, I learned that in order to use an object for the 'options' property of a field in jtable, the object must be in the following format var optionsObject = new Object(); optionsObject[Value] = DisplayText;

Categories : List

Kendo UI Web - Drop-down list, different background color on each list item.
There is one easy part and one difficult part. The easy is getting the background the difficult is making it look nice. Easy, define a template for rendering each list item: <script id="template" type="text/kendo-tmpl"> <div style="background-color: #= text #;">#= text #</div> </script> And then define your ComboBox as: $(document).ready(function () { $('#combobox').kendoComboBox({ template : $("#template").html() }); }); but this is likely to do not be as nice as you want since before the <div> from my template there is a <li> introduced by KendoUI and unless you want to start playing with it, you might consider just displaying a color square with the item color. You can do something like: Start defining a CSS for the color

Categories : CSS

Populate Telerik Drop-down list based on what is selected in other list
You can do it like this: View: <p> <%: Html.Label("Type") %> <%: Html.Telerik().DropDownList().Name("Type") .HtmlAttributes(new { id = "type" }) .Items(items => { items.Add().Text("").Value(""); items.Add().Text("Numbers").Value("1"); items.Add().Text("Alphabets").Value("2"); }) .CascadeTo("Values") %> </p> <p> <%: Html.Label("Values" %> <%: Html.Telerik().DropDownList().Name("Values") .HtmlAttributes(new { id = "values" }) .DataBinding(b => b.Ajax().Select("GetDropDownValues", "Home")) %> </p> Controller: public class HomeController : Controller { public ActionResult Index() { return View(); } [HttpPost] public JsonResult GetDropDo

Categories : C#

enum values in drop down list using ViewData and th viewcode to list it?
This will return Enum.GetNames(typeOf(Language )) English spanish Arabi And this Enum.GetValues(typeOf(Language )) 1,2,3 You can languages list to view: ViewBeg.Languages = Enum.GetNames(typeOf(Language)).ToList();

Categories : C#

Hot to Create multiple list data in one drop down list
[AcceptVerbs(Http.Get)] public ActionResult GetValueExample() { ViewData["MyItems"] = GetSelectList(); return View(); } [AcceptVerbs(Http.Get)] public ActionResult GetValueExample(string MyList) { //MyList contains the selected value SelectList list = GetSelectList(); //list will contain the original list of items //... } private SelectList GetSelectList() { Dictionary<string, string> list = new Dictionary<string, string>(); list.Add("Item 1", "1"); list.Add("Item 2", "2"); list.Add("Item 3", "3"); return new SelectList(list, "value", "key"); } //... <%= Html.DropDownList("MyList", ViewData["MyItems"] as SelectList) %>

Categories : Asp Net Mvc

Assigning a rare drop chance to object in simple Actionscript 3.0 game
Well, this is either too simple of a question, or I just didn't understand it. If I did however understand it correctly, here's the way out: Let's say you want to have a 1% chance of a falling heart. Since you're using a Number class for your chance variable, and Math.random() returns a Number as well, you don't need any transformations. Math.random() returns a Number (float) between 0 and 1, not including 1 so your code for 1% could look something like this: var chance:Number = Math.random(); if (chance <= 0.01) { //enter code here } And yes, since you call less unneeded functions, it works faster. Math.random() gives a very precise number, far beyond 1/100, so it's possible to make a much less number for chance possibility, here's one value returned from Math.random(): Math

Categories : Android

Simple batchscript breaks when drag&drop a file with an underscore in its filename
The problem is the name of the directory, in this case the commas are the problematic characters. When drag&drop a file, it will only be quoted when a space is found in the name. But in this case the commas will split the name into multiple arguments. D:Audible[..power progressive symphonic gothic..]Videos est_-_test.mp4 In this case you could use %* to access the original fullname, but in some other cases (when a & is in the name) you need a more complex solution. SO: Drag and drop batch file for multiple files?

Categories : Batch File

Drop Down list in php (help)
Try adding a blank option tag in the select, it will allow the change to trigger. function osc_list_orders_drop() { $orders = osc_list_orders(); echo '<select name="order" id="order" ONCHANGE="location = this.options[this.selectedIndex].value;">'; echo '<option></option>'; foreach($orders as $label => $params){ $orderType = ($params['iOrderType'] == 'asc') ? '0' : '1'; echo '<option value="'.osc_update_search_url($params).'">'; echo $label; echo'</option>'; } echo'</select>'; } A better option would be to add a selected="selected" to the current filter's option tag.

Categories : PHP

drop down list value in asp.net
You can add an empty value such as: ddlmonths.Items.Insert(0, new ListItem("Select Month", "")) And just add a validation to prevent chosing empty option such as asp:RequiredFieldValidator.

Categories : Asp Net

ASP.net MVC 4 Drop Down List
Have a look at the SelectList class http://msdn.microsoft.com/en-us/library/system.web.mvc.selectlist%28v=vs.108%29.aspx This goes in your model, then you can create a dropdownlist like this: @Html.DropDownList("GenderId", Model.Genders)

Categories : Asp Net

Getting value from 1st drop down list jsp
I think you may be misunderstanding the request processing lifecycle. The only way for request.getParameter("bfnsCode") to have a non-null value is if a parameter called bfnsCode was sent with the current request. That's not the case you have here (as far as I can tell), as all of your code executes within the context of a single request. So yes, bfnsCode will be null at the time you check for it. If you want one select box to respond to another within the same page, that is something that is usually/best accomplished with JavaScript. You'd want an onchange or onkeyup (or both) event handler on the first <select> box, and you'd want to implement it so that it gets the value from the first box and then uses it to update the second box (either by making an AJAX call to load in the

Categories : Java

Drop Down Nav List
Add the following styles: nav{ position:relative; } nav li ul { display: none; position: absolute; left: 10px; } This ensures that your layout doesn't break and you get what you want. Don't forget to thank me if this works ;-) Just kidding!

Categories : HTML

Changing PHP drop-down to UL LI list
<div class="wrapper-dropdown"> <span>I'm kinda the label!</span> <ul class="dropdown"> <?php $catalog_orderby = apply_filters( 'woocommerce_catalog_orderby', array( 'menu_order' => __( 'Default sorting', 'woocommerce' ), 'popularity' => __( 'Sort by popularity', 'woocommerce' ), 'rating' => __( 'Sort by average rating', 'woocommerce' ), 'date' => __( 'Sort by newness', 'woocommerce' ), 'price' => __( 'Sort by price: low to high', 'woocommerce' ), 'price-desc' => __( 'Sort by price: high to low', 'woocommerce' ) ) ); if ( get_option( 'woocommerce_enable_review_rating' ) == 'no' ) unset( $catalog_orderby['rating'] ); foreach ( $catalog

Categories : PHP

Grabbing the ID value from a drop down list in mvc
You can create a class of something like session information with the id to capture that immediately after login. Have your login perform login verification, then route to the session info page where you select the organization based off users available organization. Pass that to your helper class that stores it in session information. Edit After re-reading your question you can provide a list of organizations at the login page and do a verification against whatever you are doing currently and ensuring it matches organization too so it is only one screen. public class LoginCredential { public string UserName { get; set; } public string Password { get; set; } public int OrganizationId { get; set; } } public ActionResult Index() { ViewBag.Organizations = new SelectList

Categories : C#

how to take text box value from drop down list
Instead of idMethodSelTxt.innerText, try idMethodSelTxt.innerHTML. I am also assuming you got the idMethodSelTxt and idMethodSel variables with document.getElementById("idMethodSelTxt") before trying to access them. function showTxtbox() { var idMethodSelTxt = document.getElementById("idMethodSelTxt"); var idMethodSel = document.getElementById("idMethodSel"); idMethodSelTxt.innerHTML = idMethodSel.options[idMethodSel.selectedIndex].text; }

Categories : Javascript

Set SurfaceView behind the Drop Down List
In your code setZOrderOnTop(true); i think this explains everything, it causes the rectangle to draw on top, that's why you see like that, you should set that to false setZOrderOnTop(false); and also at your code you should declare your options dropdown list and call this on it ... yourDropDownView.bringToFront();

Categories : Android

drop down list using backgrid?
Try this var PriorityComboCell = Backgrid.Cell.extend({ template: _.template( '<select name="#" id="priority_select"> ' + '<option selected="selected"></option>' + '<option id="a">One</option>' + '<option id="b">Two</option> ' + '<option id="c">Three</option>' + '</select>' ), events: { }, render: function () { this.$el.html(this.template({})); return this; } });

Categories : Javascript

HTML5 Drop down with list
First of all remember to include <!doctype html> in your file to set the browser to "html5 standards mode" For the options tags you haw should use the value attribute. like <option value="acc">Accountants</option> In your javascript file you can access this attribute in the same way as you access the rel attribute. For the divs / the targets you should use id or class (or title) since these are all global attributes that can be assagned to any object in html5 ref: http://www.w3schools.com/tags/ref_standardattributes.asp Only use 'id' if the object is uniquely identified on your page, if you want to reference more object at a time consider using 'class'. <div class="acc"> <!-- or 'div id="acc"' --> <ul> <li><a href="http://www.balmeracco

Categories : Javascript

Styling drop down list for in MVC
Html.DropDownListFor renders a <select>, so I don't know why you're saying you're not using <select> tags. CSS does not care about server-side code, only rendered HTML, so if you're having issues then always show us the rendered HTML and your CSS. Anyway, to style your <select> element (and remember that because <select> is a "replaced element" in CSS the opportunities for styling are limited, but you can do some cool things: http://bavotasan.com/2011/style-select-box-using-only-css/ You can override the id="" attribute of the <select> so you can use the element selector in CSS, like so: <%: Html.DropDownListFor(model => model.teamIdAway, Model.getTeams, new { id = "mySelect" })%> #mySelect { width: 135px; } However if you're using this DropDow

Categories : HTML

Validation of a drop down list in PHP
In addition to checking if the variable is set, you need to check if it's not empty: if (!isset($_POST['cboproduit']) || $_POST['cboproduit'] === '') { $message .= "Vous devez sélectionner un téléphone <br />"; }

Categories : PHP

JSP use contents of an array list in a drop down box
You can add the bellow line just after the for loop in your scriptlet: request.setAttribute("availableLines", availableLines); And then you can use the availableLines variable in your drop down list using JSTL like bellow: <select> <c:forEach var="line" items="${availableLines}"> <option><c:out value="${line}"/></option> </c:forEach> </select> I think, this answers your original question. Edit: But one thing you should know that, writing scriptlet is deprecated for years! So it is advised to move your scriptlet code to your corresponding servlet. Here is a step by step tutorial for Servlet and jsp for beginners.

Categories : Java

Drop down list data bind
Use the SelectedIndexChanged event of the first to set the default value on the second. Like this: void foo_SelectedIndexChanged(object sender, EventArgs e) { bar.SelectedIndex = ((DropDownList)sender).SelectedIndex; // or whatever your logic is. Merry coding. }

Categories : C#

Drop down list not binding with sqldatareader
Either you will have to make a seperate reader for each binding or you can do this by filling a datatable ( i would prefer this). Like, DataTable dt = new DataTable(); using (SqlDataAdapter a = new SqlDataAdapter(sql, connection)) { a.Fill(dt); } drClient.DataSource = dt; drClient.DataBind(); drBranch.DataSource = dt; drBranch.DataBind(); drContact.DataSource = dt; drContact.DataBind(); drFax.DataSource = dt; drFax.DataBind();

Categories : C#

MVC populate drop down list no postback
Most common scenario is generating the second dropdownlist values depending on the first DropDownList selected item changed. I assume that you are looking for the same scenario and below code is for achieve that. Let me know if you really need the button click to generate the second dropdown. Model: namespace MvcApplicationrazor.Models { public class CountryModel { public List<State> StateModel { get; set; } public SelectList FilteredCity { get; set; } } public class State { public int Id { get; set; } public string StateName { get; set; } } public class City { public int Id { get; set; } public int StateId { get; set; } public string CityName { get; set; } } } Controller: public Actio

Categories : Asp Net Mvc

How to link HTML drop down list
If you want the action to take place when the select is changed you need a client side solution like javascript, preferably jQuery. PHP cannot do what you asking, it can do something when the form is submitted but not when the select is changed. http://api.jquery.com/change/ <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> $(document).ready(function(){ $("select").on("change", function(){ alert("The value is " + $(this).val()); }); }); That will produce an alert when your select is changed.

Categories : PHP

Why does do.call drop rows from my list
This reproduces the error. You should have some NULL entries in your list. ll <- list(letters[1:2],letters[1:2],c(NULL,NULL)) str(ll) List of 3 $ : chr [1:2] "a" "b" $ : chr [1:2] "a" "b" $ : NULL str(do.call(rbind,ll)) chr [1:2, 1:2] "a" "a" "b" "b" Try to remove NULL values: ll[!unlist(lapply(ll,is.null))]

Categories : R

JQuery drop-down list selection
You could use jquery's change(). This will be triggered when you change a value in the drop down menu. Usage would be something like this : $("select").change( function () { var val=this.value; switch (val) { case "reset" : //do action for reset break; case "someother" : //do something else break; } ) Note You'll have to put this code after you append the drop down into your html. Your drop down must exist in the DOM for this event to get attached to the dropdown. For note info on this, see docs

Categories : Jquery



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.