Search Results

Search found 29816 results on 1193 pages for 'select tag'.

Page 6/1193 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • Java: JPQL select statement

    - by bguiz
    select x from X x where x.a.id = :a_id -- Always 0 objects selected Why does the above JPQL statement not work, but the one below work? select a from A a where a.id = :a_id -- a_obj select x from X x where x.a = :a_obj -- Always correct number of objects selected Neither query throws an exception during execution, but a different number of results are obtained. Thanks

    Read the article

  • How can I return a sql select into a sql variable

    - by Matt
    Hi, I'm trying to put the results of a SELECT into a variable and loop through the results to manipulate that data, all in the same stored proceedure... Here's what I have so far: DECLARE @i int @Result = (SELECT * FROM UserImport) SET @i = 0 WHILE @i < (SELECT Count(@Result) As Count) BEGIN /* Do Stuff */ END I know I'm way off because it's saying @Result was not declared, but I'm not sure how to declare a variable to be able to hold the results of a SELECT statement. Can anyone tell me where i'm going wrong and how to fix it? Thanks, Matt

    Read the article

  • Clear Select options when selecting one field while using multiple forms on same page

    - by Nizam
    Hi all, I have a situation where the second select list option is generated from the first select list selected option. Like when we select Country corresponding states are generated in next select list. In my case I am having multiple forms on single page which are same. Can anyone let me know how to implement it on multiple forms. I tried the following code but it didn't work $(".country").change(function(){ $.get("sample.php?val=" + $(this).val(), function(data){ $(this).parent().next().children('.state').children('option').remove(); $(this).parent().next().children('.state').append(data); }); Waiting for your support thanks in advance

    Read the article

  • Hiding Options of a Select with JQuery

    - by Syed Abdul Rahman
    Okay, let's start with an example. Keep in mind, this is only an example. <select id = "selection1">     <option value = "1" id = "1">Number 1</option>     <option value = "2" id = "2">Number 2</option>     <option value = "3" id = "3">Number 3</option> </select> Now from here, we have a dropdown with 3 options. What I want to do now is to hide an option. Adding style = "display:none" will not help. The option would not appear in the dropdownlist, but using the arrow keys, you can still select it. Essentially, it does exactly what the code says. It isn't displayed, and it stops there. A JQuery function of $("#1").hide() will not work. Plus, I don't only want to hide the option, I want to completely remove it. Any possibility on doing so? Do I have to use parent/sibling/child elements? If so, I'm still not sure how. Any help on this would be greatly appreciated. Thanks.           Another question - It's related Ok, so I found out that there is a .remove() available in JQuery. Works well. But what if I want to bring it back? if(condition)     {     $(this).remove();     } I can loops this. Shouldn't be complicated. But the thing of which I am trying to do is this: Maximum Capacity of Class: (Input field here) Select Room: (Dropdown here) What I'd like for it to do is to update is Dropdown using a function such as .change() or .keyup. I could create the dropdown only after something is typed. At a change or a keyup, execute the dropdown accordingly. But what I am doing is this: $roomarray = mysql_query("SELECT *     FROM         (         SELECT *,         CASE         WHEN type = 'Classroom' THEN 1         WHEN type = 'Computer laboratory' THEN 2         WHEN type = 'Lecture Hall' THEN 3         WHEN type = 'Auditorium' THEN 4         END AS ClassTypeValue         FROM rooms         ) t     ORDER BY ClassTypeValue, maxppl, roomID"); echo "<select id = \"room\">"; while ($rooms = mysql_fetch_array($roomarray)) { ?> <option value=<?php echo $rooms['roomID']; ?> id=<?php echo $rooms['roomID']; ?>><?php echo $rooms['type']; echo "&nbsp;"; echo $rooms['roomID']; echo "&nbsp;("; echo $rooms['maxppl']; echo ")"; ?></option> <?php } echo "</select>"; Yes, I know it is very messy. I plan to change it later on. But the issue now is this: Can I toggle the removal of the options according to what has been typed? Is it possible to do so with a dropdown made from a loop? Because I sure as hell can't keep executing SQL Queries. Or is that even an option? Because if it's possible, I still think it's a bad one.

    Read the article

  • Tag Cloud Data Backend

    - by Waldron
    I want to be able to generate tag clouds from free text that comes from any number of different sources. For clarity, I'm not talking about how to display a tag cloud once the critical tags/phrases are already discovered, I'm hoping to be able to discover the meaningful phrases themselves... preferable on a PHP/MySQL stack. If I had to do this myself, I'd start by establishing some kind of index for words/phrases that gives a "normal" frequency for any word/phrase. eg "Constantinople" occurs once in every 1,000,000 words on average (normal frequency "0.000001"). Then as I analyze a body of text, I'd find the individual words/phrases (another challenge!), find frequencies of each within the input, and measure against the expected freqeuncy. Words that have the highest ratio against expected frequency get boosted priority in the cloud. I'd like to believe someone else has already done this, WAY better than I could hope to, but I'll be damned if I can find it. Any recommendations??

    Read the article

  • Problems re-populating select options in Rails when form returned with errors

    - by Rick
    I have a form with 2 select options in it -- frequency and duration. When there are errors with the form, and it is returned to the browser, the select options are not re-populated with the selections the user made even though the returned values for those fields match the values of options in the selects. Also, when the form is returned, these fields are not marked as having errors even though their values are blank. Here's the frequency and duration fields in Rails <%= frequency_select c, :frequency %> <%= duration_select c, :duration %> The method for frequency_select is def frequency_select(f, method) options = [["day", 1.day], ["other day", 2.days], ["week", 1.week]] f.select method, options, :include_blank => true end And the method for duration_select is def duration_select(f, method, unit="day" ) values, units = *case unit when "day" : [[[5, 5], [15, 15], [30, 29]], "days"] when "other day" : [[[15, 15], [30, 29], [45,45]], "days"] when "week" : [[[4, 29], [6, 43], [8, 57]], "weeks"] end f.select method, values.map {|(label, i)| ["#{label} #{units}", i.days]}, :include_blank => true end If you enter a value into one or both of these fields and submit the form without completing part of it (any part of it), the form is returned to the user (as would be expected), but the duration and frequency fields are not re-populated with the user's selection. If I add this bit of code to the form <p><%= @challenge.attributes.inspect %></p> I see that this for duration and frequency when the form is returned to the browser: "duration"=>3888000, "frequency"=>172800 These values match values on the options in the select fields. Is there anything special in Rails that needs to be done so that the select fields are re-populated with the user's selections? Any thoughts on what the problem could be or what I should try next? Help is greatly appreciated! -Rick PS If you look at some of the other questions, you'll notice I've asked about this in the past. At one point, I thought the form was returning values for frequency and duration in days rather than seconds, but that's not the case. PPS Here's one other bit of information that might matter, but my tests indicate that it probably does not. (Though, I'm a bit of a newbie to this, so don't take my word for it.) These two fields are chained together using the cascade jquery plugin. The javascript is included on the page (not in a separate file) and some of the js is being created by Rails. First, here are the scripts as they appear in the browser. The first is the script to generate the options for the duration select and the second is the script required by the Cascade plugin to trigger the field chaining. <script type="text/javascript"> var list1 = [ {'When':'86400','Value':' ','Text':' '}, {'When':'172800','Value':' ','Text':' '}, {'When':'604800','Value':' ','Text':' '}, {'When':'86400','Value':'432000','Text':'5 days'}, {'When':'86400','Value':'1296000','Text':'15 days'}, {'When':'86400','Value':'2505600','Text':'30 days'}, {'When':'172800','Value':'1296000','Text':'15 days'}, {'When':'172800','Value':'2505600','Text':'30 days'}, {'When':'172800','Value':'3888000','Text':'45 days'}, {'When':'604800','Value':'2505600','Text':'4 weeks'}, {'When':'604800','Value':'3715200','Text':'6 weeks'}, {'When':'604800','Value':'4924800','Text':'8 weeks'} ]; function commonTemplate(item) { return "<option value='" + item.Value + "'>" + item.Text + "</option>"; }; function commonMatch(selectedValue) { return this.When == selectedValue; }; </script> <script type="text/javascript"> jQuery(document).ready(function(){ jQuery("#challenge_duration, #user_challenge_duration").cascade("#challenge_frequency, #user_challenge_frequency",{ list: list1, template: commonTemplate, match: commonMatch }) }); </script> And here's a bit of the the first script as it is in the erb file -- you see that some of the script is being generated by Rails <%= [ [1.day, [[5, 5], [15,15], [30, 29]], "days"], [2.days, [[15, 15], [30, 29], [45, 45]], "days"], [1.week, [[4, 29], [6, 43], [8, 57]], "weeks"]].map do |(frequency, durations, unit)| durations.map do |(label, value)| "{'When':'#{frequency}','Value':'#{value.days}','Text':'#{label} #{unit}'}" end end.join(",\n") -%> Now, the reason I don't think that it matters whether the duration is being generated with JS is the problem still exists if I remove all the JS the problem also affects the frequency field, whose options are not being generated by the JS

    Read the article

  • How do I pass struts2 <s:select multiple="true"> with a Map

    - by deepblue
    I have an bean placed on my action Event.java, the action is Called ManageEvents. I would like the user to be able to add to a struts2 multiple select form field and create a list or map of items (in this case Map where the data would be . <struts2:select name="event.dj_map" label="Add DJs To Your Event" list="event.dj_map" listsize="5" multiple="true" headerKey="headerKey" required="true" headerValue="--- Please Select ---"> So ultimately I would like to know how to pass a mult. select field (e.g. Events.dj_map) as a map of name,value pairs to an object (e.g. Event.java) set on the action (e.g. ManageEvents.java).

    Read the article

  • Multiple/nested "select where" with Zend_Db_Select

    - by DJRayon
    Hi there I need to create something like this: select name from table where active = 1 AND (name LIKE 'bla' OR description LIKE 'bla') The first part is easy: $sqlcmd = $db->select() ->from("table", "name") ->where("active = ?", 1) Now comes the tricky part. How can I nest? I know that I can just write ->orWhere("name LIKE ? OR description LIKE ?", "bla") But thats wron, because I need to dynamically change all the parts. The query will be built all the time the script runs. Some parts get deleted, some altered. In this example I need to add those OR-s because sometimes I need to search wider. "My Zend Logic" tells me that the correct way is like this: $sqlcmd = $db->select() ->from("table", "name") ->where("active = ?", 1) ->where(array( $db->select->where("name LIKE ?", "bla"), $db->select->orWhere("description LIKE ?", "bla") )) But that doesn't work (atleast I dont remember it working). Please. Can someone help me to find a object oriented way for nesting "where"-s

    Read the article

  • Waiting for data via select not working

    - by BSchlinker
    I'm currently working on a project which involves multiple clients connected to a server and waiting for data. I'm using select and monitoring the connection for incoming data. However, the client just continues to print nothing, acting as if select has discovered incoming data. Perhaps I'm attacking this wrong? For the first piece of data the server does send, it is displayed correctly. However, the server then disconnects and the client continues to spew blank lines. FD_ZERO(&readnet); FD_SET(sockfd, &readnet); while(1){ rv = select(socketdescrip, &readnet, NULL, NULL, &timeout); if (rv == -1) { perror("select"); // error occurred in select() } else if (rv == 0) { printf("Connection timeout! No data after 10 seconds.\n"); } else { // one or both of the descriptors have data if (FD_ISSET(sockfd, &readnet)) { numbytes = recv(sockfd, buf, sizeof buf, 0); printf("Data Received\n"); buf[numbytes] = '\0'; printf("client: received '%s'\n",buf); sleep(10); } } }

    Read the article

  • Create form select from object containing values

    - by marks34
    I have such an object : var options = {1: 'Running', 2: 'Falling', 3: 'Collapsing wall', 4: (...)}; I'd like to create form's select element with ooptions taken from this object, so something like that (code I tried which is not working, but you can get the idea) : html = '<form action="" ><select name="block-action"><option>-------</option>'; for(k in obj){ html += '<option value="'+k+'">'+obj[k]+'</option>' } html += '</select></form>'

    Read the article

  • Dojo Select widget validation style

    - by jamstooks
    Many dojo form widgets, like DateTextBox will style themselves in red (claro theme) with an "!" to indicate that the field isn't valid after focus. I can't seem to get this type of styling to work with the Select widget. I have the value set to required, but if the user leaves it in the default state, blank, then it remains unstyled. I tried to test this programmatically: wigs = dijit.findWidgets(node); for( i = 0; i < wigs.length; i++ ) { wigs[i].focus(); } This triggers validation on several other widgets and they are styled appropriately, but not he Select widgets. Anyone know how to make it obvious that those select widgets are not validating? Oh, and wigs[i].isValid() is definitely false for those select widgets.

    Read the article

  • How do I select an option using Spring's form:select tag?

    - by Dave
    I'm using Spring 3.1.1.RELEASE. Using the form:select tag, how do I specify which option should be selected? I want the first one to be selected, but when I put <form:select path="parentOrganization"> <form:option value="" label="Select an Org Type or Parent Org" /> <form:options items="${orgTypesWoParents}" itemValue="id" itemLabel="description" /> <form:option value="" label="=======================" /> </form:select> the last one is selected. I want to preserve the order of how everything is displayed, which is why I've arranged things in this way.

    Read the article

  • C# Linq Select Problem in Method Chain.

    - by Gnought
    Note that the _src inherit IQueryable<U> and V inherit new(); I wrote the following statement, there is no syntax error. IQueryable<V> a = from s in _src where (s.Right - 1 == s.Left) select new V(); But if i re-wrote it as follows, the Visual Studio editor complains an error in the "Select" IQueryable<V> d = _src.Where(s => s.Right - 1 == s.Left).Select(s=> new V()); The Error is: The type arguments cannot be inferred from the usage. Try specifying the type arguments explicitly. Candidates are: System.Collections.Generic.IEnumerable<V> Select<U,V>(this System.Collections.Generic.IEnumerable<U>, System.Func<U,V>) (in class Enumerable) System.Linq.IQueryable<V> Select<U,V>(this System.Linq.IQueryable<U>, System.Linq.Expressions.Expression<System.Func<U,V>>) (in class Queryable) Could anyone explain this phenomenon, and what the solution is to fix the error?

    Read the article

  • Tag suggestion (not tag autocomplete)

    - by takeshin
    AJAX autocomplete is fairly simple to implement. However, I wonder how to handle smart tag suggestion like this on SO. To clarify the difference between autocomplete and suggestion: autocomplete: foo [foobar, foobaz] suggestion: foo [barfoo, foobar, foobaz], or even better, with 'did you mean' feature: [barfoo, foobar, foobaz, fobar, fobaz] I suppose I need some full text search in tags (all letters indexed, not just words). There would be no problem to do it witch regex or other patterns for limited number of tags (even client side). But how to implement this feature for big number of tags? Is there any particular reason (besides URL) the tags on SO are dash separated? What about Unicode characters in tags? I store the tags in the table with the following columns: id, tagname. My SQL query returns objects with following fields: id, tagname, count

    Read the article

  • Django Template tag, generating template block tag

    - by Issy
    Hi Guys, Currently a bit stuck, wondering if anyone can assist. I am using django-adminfiles. Which is a near little application. I want to use it to insert images into posts/articles/pages for a site i am building. How django-adminfiles works is it inserts a placeholder i.e <<< ImageFile and this gets rendered using a django template. It also has the feature of inserting custom options i.e (Insert Medium Image) , i figured i would used this to automatically resize images and include it in the post (similar to how WP does it). Django-adminfiles makes use of sorl.thumbnail app to generate thumbnails. So i have tried testing generating thumbnails: The current template that is used to render the inserted image is: {% spaceless %} <img src="{{ upload.upload.url }}" width="{{ upload.width }}" height="{{ upload.height }}" class="{{ options.class }}" class="{{ options.size }}" alt="{% if options.alt %}{{ options.alt }}{% else %}{{ upload.title }}{% endif %}" /> {% endspaceless %} I tried modifying this to: {% load thumbnail %} {% spaceless %} <img src="{% thumbnail upload.upload.url 200x50 %}" width="{{ upload.width }}" height="{{ upload.height }}" class="{{ options.class }}" class="{{ options.size }}" alt="{% if options.alt %}{{ options.alt }}{% else %}{{ upload.title }}{% endif %}" /> {% endspaceless %} I get the error: Exception Value: Caught an exception while rendering: Source file: '/media/uploads/DSC_0014.jpg' does not exist. I figured the thumbnail needs the absolute path so tried putting that in the template, and that works. i.e this works: {% thumbnail '/Users/me/media/uploads/DSC_0014.jpg' 200x50 %} So basically i need to generate the absolute path to the file give the relative path (to web root). You could do this by passing the MEDIA_ROOT setting to the template, but the reason i want to do a template tag is to programmatically set the image size.

    Read the article

  • Delete blank row in dropdownlist or select default value in infopath dropdown

    - by KunaalKapoor
    Regular Dropdown (Pulling from DataSource)1. Double click on dropdown field in the data source.2. Select Fx button for Default value.3. Select Insert field or group.4. Select secondary xml from data source.5. Select “value” and click on ok.For a cascading dropdown:You have to add the rule and follow these steps,1. Rules -> ‘Add’ - > ‘Add Action’.2. Select ‘Set a field value’ option in first dropdown in Action.3. Select your field with help of ‘Select a Field or Group’ option in ‘Field’.4. Select your external data source list value in ‘Value’.This rule you can apply in OnLoad or whenever you will get external data source values.

    Read the article

  • Sliding & hiding multiple panels in jQuery.

    - by lloydphillips
    I have a table with multiple rows in each row is a select list and based on the selection (when the onchange event is fired) panels appear containing additional data below the row.I currently have code like this: var allPnls = '.inv-dtl-comnts-add,.inv-dtl-comnts-update'; $(document).ready(function(){ hideAll(); //select action change $(".inv-dtl-ddlaction").change(onSelectChange); $(".btn-cancel").click(function(event){ slideAll(); $(".inv-dtl-ddlaction").val('[Select an Action]'); return false; }); }); function onSelectChange(event){ //find out which select item was clicked switch($(this).val()) { case 'View/Add Comment': $(this).closest(".row").children(allPnls).slideUp("fast", function(){ $(this).closest(".row").children(".inv-dtl-comnts-add").slideToggle("fast"); }); break; case 'Change Status': $(this).closest(".row").children(allPnls).slideUp("fast", function(){ $(this).closest(".row").children(".inv-dtl-comnts-update").slideToggle("fast"); }); break; default: //code to be executed if n is different from case 1 and 2 } } function hideAll(){ $(allPnls).hide(); } function slideAll(){ $(allPnls).slideUp("fast"); } So I'm hiding all the panels when the page loads and if a panel is already open I want to slide it shut before reopening the new panel. This works with the postback. With just one panel in the selection it worked great but with two panels the sliding up happens twice (it seems to slide down unopened panels before sliding them back up again). How can I adjust this so that I can get all panels listed in the variable allPnls to slide shut ONLY if they are already open? Is there a better way of sliding the panels shut and then having a callback to have the slideToggle work? Lloyd

    Read the article

  • MySQL Many to Many with Unique keys and Update/Select if Exists otherwise Insert

    - by Jayrox
    In my goal to have a Many-to-Many relationship in my MySQL database I have arrived at another bridge to build. Current Tables: Users (id, name) Tags (id, name) User_Tags (user_id, tag_id) Here is the goal: I would like to have the ability to take a tag i.e: #fb and insert it into my Tags database which has a unique constraint on name and if the tag exists I would like to return it's id I would like to insert the tag.id and the current user's user.id into User_Tags. I do not have any unique constraints on the User_Tags table because I would like to be able to track the user's most commonly used tags and present them in a list ordered by frequency of use. I am currently developing this project in PHP using prepared statements. Additionally, performance is not currently an issue as my user count is still fairly small, but it is steadily growing and may be an issue in the future.

    Read the article

  • How to anchor with <option> tag in HTML?

    - by blub
    I'm trying to anchor a div with an option tag but it doesn't work, what´s wrong with my code? Here´s the anchor snippet <select> <option value="#b1">1 test</option> </select> <br /> <br /> <br /> <br /> <br /> <br /> <div id="b1">Testing!</div>

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >