Search Results

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

Page 12/1193 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Making a select choice result in a popup in javascript

    - by Ryan Johsonson
    So this is using javascript and HTML. For example: <select name='test' > <option value='1'> <option value='2'> <option value='3'> </select> If someone chooses option value 2 (from the dropdown) I want a popup to appear. However if they choose option value 1 or option value 3 (from the dropdown) I want nothing to happen. How can I do this? Thanks

    Read the article

  • First time using select(), maybe a basic question?

    - by darkletter
    Hello people, i've been working for a few days with this server using select(). What it does, is that, i have two arrays of clients (one is "suppliers", and the other is "consumers"), and the mission of the server is to check whether the suppliers have something to send to the consumers, and in case affirmative, send it. The second part of the server is that, when the consumers have received the suppliers' info, they send a confirmation message to the same suppliers that sent the info. When a client connects, it gets recognized as "undefined", until it sends a message with the word "supplier" or "consumer" (in Spanish, as i'm from there), when the server puts it in the correct clients array. Well, what the server does is not very important here. What's important is that, i'm doing both parts with two different "for" loops, and that's where i'm getting the problems. When the first user connects to the server (be it a supplier or a consumer), the server gets stuck in the first or second loop, instead of just continuing its execution. As it's the first time i'm using select(), i may be missing something. Could you guys give me any sort of help? Thanks a lot in advance. for(;;) { rset=allset; nready=select(maxfd+1,&rset,NULL,NULL,NULL); if (FD_ISSET(sockfd, &rset)){ clilen=sizeof(cliente); if((connfd=accept(sockfd,(struct sockaddr *)&cliente,&clilen))<0) printf("Error"); IP=inet_ntoa(cliente.sin_addr); for(i=0;i<COLA;i++){if(indef[i]<0){indef[i]=connfd;IPind[i]=IP;break;}} FD_SET(connfd,&allset); if(connfd > maxfd) maxfd=connfd; if(i>maxii) maxii=i; if(--nready<=0) continue; }// Fin ISSET(sockfd) for(i=0;i<=maxii;i++){ if((sockfd1=indef[i])<0){ continue;} //! if(FD_ISSET(sockfd1,&rset)){ if((n=read(sockfd1,comp,MAXLINE))==0){close(sockfd1);FD_CLR(sockfd1,&allset);indef[i]=-1;printf("Cliente indefinido desconectado \n");} else{ comp[n]='\0'; if(strcmp(comp,"suministrador")==0){ for(j=0;j<=limite;j++){if(sumi[j]<0){IPsum[j]=IPind[i];sumi[j]=indef[i]; indef[i]=-1;if(j>maxis) {maxis=j;}break; } } } else if(strcmp(comp,"consumidor")==0){ for(o=0;j<=limite;j++){if(consum[o]<0){IPcons[o]=IPind[i];consum[o]=indef[i]; indef[o]=-1;if(o>maxic) {maxic=o;}break; } } } if(--nready <=0)break; } } }//fin bucle for maxii for(i=0;i<=maxis;i++){ if((sockfd2=sumi[i])<0){continue;} if(FD_ISSET(sockfd2,&rset)){ if((n=read(sockfd2,buffer2,MAXLINE))==0){close(sockfd2);FD_CLR(sockfd2,&allset);sumi[i]=-1;printf("Suministrador desconectado \n");} else{ buffer2[n]='\0'; for(j=0;j<=maxic;j++){ if((sockfd3=consum[j])<0){ continue;} else {strcpy(final,IPsum[i]);strcat(final,":");strcat(final,buffer2);write(sockfd3,final,sizeof(final));respuesta[i]=1;} } break; // ? } } }//fin for maxis for(i=miniic;i<=maxic;i++){ if((sockfd4=consum[i])<0){continue;} if(FD_ISSET(sockfd4,&rset)){ if((n=read(sockfd4,buffer3,MAXLINE))==0){close(sockfd4);FD_CLR(sockfd4,&allset);consum[i]=-1;printf("Consumidor desconectado \n");} else{ buffer3[n]='\0'; IP2=strtok(buffer3,":"); obj=strtok(NULL,":"); for(j=0;j<100;j++){ if((strcmp(IPsum[j],IP2)==0) && (respuesta[j]==1)) {write(sumi[j],obj,sizeof(obj)); miniic=i+1; respuesta[j]=0; break; } } } } }

    Read the article

  • Select the latest record for each category linked available on an object

    - by Simpleton
    I have a tblMachineReports with the columns: Status(varchar),LogDate(datetime),Category(varchar), and MachineID(int). I want to retrieve the latest status update from each category for every machine, so in effect getting a snapshot of the latest statuses of all the machines unique to their MachineID. The table data would look like Category - Status - MachineID - LogDate cata - status1 - 001 - date1 cata - status2 - 002 - date2 catb - status3 - 001 - date2 catc - status2 - 002 - date4 cata - status3 - 001 - date5 catc - status1 - 001 - date6 catb - status2 - 001 - date7 cata - status2 - 002 - date8 catb - status2 - 002 - date9 catc - status2 - 001 - date10 Restated, I have multiple machines reporting on multiple statuses in this tblMachineReports. All the rows are created through inserts, so their will obviously be duplicate entries for machines as new statuses come in. None of the columns can be predicted, so I can't do any ='some hard coded string' comparisons in any part of the select statement. For the sample table I provided, the desired results would look like: Category - Status - MachineID - LogDate catc - status2 - 002 - date4 cata - status3 - 001 - date5 catb - status2 - 001 - date7 cata - status2 - 002 - date8 catb - status2 - 002 - date9 catc - status2 - 001 - date10 What would the select statement look like to achieve this, getting the latest status for each category on each machine, using MS SQL Server 2008? I have tried different combinations of subqueries combined with aggregate MAX(LogDates)'s, along with joins, group bys, distincts, and what-not, but have yet to find a working solution.

    Read the article

  • Using HtmlAnchor for anchor tag that navigates in-page named anchor

    - by Frank Schwieterman
    I am trying to render a simple hyperlink that links to a named anchor within the page, for example: <a href="#namedAnchor"scroll to down</a <a name="namedAnchor"down</a The problem is that when I use an ASP.NET control like asp:HyperLink or HtmlAnchor, the href="#namedAnchor" is rendered as href="controls/#namedAnchor" (where controls is the subdirectory where the user control containing the anchor is). Here is the code for the control, using two types of anchor controls, which both have the same problem: <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Test.ascx.cs" Inherits="TestWebApplication1.controls.Test" % <a href="#namedAnchor" runat="server"HtmlAnchor</a <asp:HyperLink NavigateUrl="#namedAnchor" runat="server"HyperLink</asp:HyperLink The generated source looks like: <a href="controls/#namedAnchor"HtmlAnchor</a <a href="controls/#namedAnchor"HyperLink</a I really just want: <a href="#namedAnchor"HtmlAnchor</a <a href="#namedAnchor"HyperLink</a I am using the HtmlAnchor or HyperLink class because I want to make changes to other attributes in the code behind. I do not want to introduce a custom web control for this requirement, as the requirement I'm pursuing is not that important and it would be hard to talk the team into abandoning the traditional ASP.NET link controls. It seems like I should be able to use the ASP.NET link controls to generate the desired link.

    Read the article

  • jquery link tag enable disable

    - by nirmal
    I want to disable the link during onloading, for the code given below <span id="addlink">"<%= f.add_associated_link('Add Task', @project.tasks.build, :class=>"add") %></span> please,suggest some answers if you have i tried with the below samples but not working $("#addlink").attr("disabled", "disabled"); and $("a.add").hide();

    Read the article

  • Referencing a union inside a structure using union tag gives incorrect address

    - by AlanKley
    I had a need to declare a union inside a structure as defined below: struct MyStruct { int m_DataType; DWORD m_DataLen; union theData { char m_Buff [_MAX_PATH]; struct MyData m_myData; } m_Data; }; Initially, I tried accessing the union data as follows (before I added the m_Data declaration): MyStruct m_myStruct; char* pBuff = m_myStruct.theData::m_Buff; This compiles but returns to pBuff a pointer to the beginning of the MyStruct structure which caused me to overwrite the m_DataType & m_DataLength members when I thought I was writing to the m_Buff buffer. I am using Visual Studio 2008. Can anyone explain this unexpected behavior? Thanks.

    Read the article

  • Rails 3 - Category Filter Using Select - Load Partial Via Ajax

    - by fourfour
    Hey. I am trying to filter Client Comments by using a select and rendering it in a partial. Right now the partial loads @client.comments. I have a Category model with a Categorizations join. This all works, just need to know how to get the select to call the filter action and load the partial with ajax. Thanks for you help. Categories controller: def filter_category @categories = Category.all respond_to do |format| format.js # filter.rjs end end filter.js.erb: page.replace_html 'client-not-inner', :partial => 'comments', :locals => { :com => Category.first.comments } show.html.erb (clients) <% form_tag(filter_category_path(:id), :method => :put, :class => 'categories', :remote => true, :controller => 'categoires', :action => 'filter') do %> <label>Categories</label> <%= select_tag(:category, options_for_select(Category.all.map {|category| [category.name, category.id]}, @category_id)) %> <% end %> <div class="client-note-inner"> <%= render :partial => 'comments', :locals => { :com => @comments } %> </div><!--end client-note-inner--> Hope that makes sense. Cheers.

    Read the article

  • Simple Select Statement on MySQL Database Hanging

    - by AlishahNovin
    I have a very simple sql select statement on a very large table, that is non-normalized. (Not my design at all, I'm just trying to optimize while simultaneously trying to convince the owners of a redesign) Basically, the statement is like this: SELECT FirstName, LastName, FullName, State FROM Activity Where (FirstName=@name OR LastName=@name OR FullName=@name) AND State=@state; Now, FirstName, LastName, FullName and State are all indexed as BTrees, but without prefix - the whole column is indexed. State column is a 2 letter state code. What I'm finding is this: When @name = 'John Smith', and @state = '%' the search is really fast and yields results immediately. When @name = 'John Smith', and @state = 'FL' the search takes 5 minutes (and usually this means the web service times out...) When I remove the FirstName and LastName comparisons, and only use the FullName and State, both cases above work very quickly. When I replace FirstName, LastName, FullName, and State searches, but use LIKE for each search, it works fast for @name='John Smith%' and @state='%', but slow for @name='John Smith%' and @state='FL' When I search against 'John Sm%' and @state='FL' the search finds results immediately When I search against 'John Smi%' and @state='FL' the search takes 5 minutes. Now, just to reiterate - the table is not normalized. The John Smith appears many many times, as do many other users, because there is no reference to some form of users/people table. I'm not sure how many times a single user may appear, but the table itself has 90 Million records. Again, not my design... What I'm wondering is - though there are many many problems with this design, what is causing this specific problem. My guess is that the index trees are just too large that it just takes a very long time traversing the them. (FirstName, LastName, FullName) Anyway, I appreciate anyone's help with this. Like I said, I'm working on convincing them of a redesign, but in the meantime, if I someone could help me figure out what the exact problem is, that'd be fantastic.

    Read the article

  • jQuery toggle div from select option

    - by Jeffrey
    I'm in need to toggle divs from a dropdown select option box. I'd like it similar to asmselect for jquery but instead of listing the option tag I'd like it to display a hidden div. Is there anything like this out there? Or anyone know how to set it up? Thanks, Jeff.

    Read the article

  • PDO empy result from SELECT when using AND

    - by Jurgen
    Hello, I've come upon a rather interesting thing, which I can't seem to figure out myself. Everytime when executing a SQL statement which contains a '... AND ...' the result is empty. Example: echo('I have a user: ' . $email . $wachtwoord . '<br>'); $dbh = new PDO($dsn, $user, $password); $sql = 'SELECT * FROM user WHERE email = :email AND wachtwoord= :wachtwoord'; $stmt = $dbh->prepare($sql); $stmt->bindParam(:email,$email,PDO::PARAM_STR); $stmt->bindParam(:wachtwoord,$wachtwoord,PDO::PARAM_STR); $stmt->execute(); while($row = $stmt->fetchObject()) { echo($row-email . ',' . $row-wachtwoord); $user[] = array( 'email' = $row-email, 'wachtwoord' = $row-wachtwoord ); } The first echo displays the correct values, however the line with echo($row->email . ',' . $row->wachtwoord); is never reached. A few things I want to add: 1) I am connected to the database since other queries work, only the ones where I add an 'AND' after my 'WHERE's fail. 2) Working with the while works perfectly with queries that do not contain '... AND ...' 3) Error reporting is on, PDO gives no exceptions on my query (or anything else) 4) Executing the query directly on the database does give what I want: SELECT * FROM user WHERE email = '[email protected]' AND wachtwoord = 'jurgen' I can stare at it all day long again (which I already did once, but I managed to work around the 'AND'), but maybe one of you can give me a helping hand. Thank you in advance. Jurgen

    Read the article

  • Dragging a copy of all selected elements from a select box--possible?

    - by Sean
    I have a picklist web interface: a pair of select elements with a pair of buttons (a left-pointing arrow and a right-pointing arrow) between them. Users can move items between the two columns by, eg, selecting one of options in the left column and clicking on the right-pointing arrow. Now I have an enhancement request: someone wants to be able to drag-and-drop items between the two columns instead of clicking a button. The problem with my initial two-select-box setup is that as soon as I click one of the highlighted options to initiate a drag, all of the other selected options are deselected. Using jQuery, I've attached mousedown event handlers to both the select boxes and each individual option that just call preventDefault() on the event object, but this isn't sufficient. On Firefox 3 the clicked-on option loses focus immediately, but all other options are still deseleted, and on IE6 (which I regrettably still have to support) it makes no difference at all. So I thought I could maybe create a reasonable facsimile of a select box using list elements or divs or something. I can create something reasonable-looking that works on Firefox, but on IE6, if I shift-click on an element of my pseudo-select object (in order to select a range of options), IE selects all of the text between where I click and the last place I clicked. Again, I've attached preventDefault-ing mousedown, mouseup, and click handlers to all of the elements involved, but it doesn't help. I've even tried overlaying transparent divs over both my original select boxes and my pseudo-select objects, thinking to intercept mouse clicks and manage the selections manually, but I can't make it work on IE. If I use a select box, I can't prevent clicks from changing the selection, and if I use text that just looks like a select element, I can't prevent it from selecting a range of text on a shift-click. Is there some general solution, or am I just out of luck?

    Read the article

  • How to write this Link2Sql select query

    - by RememberME
    I have 3 tables: subcontracts, companies and contacts. Each table has a active_status flags which shows that the item is still active (hasn't been deleted). Each contact has a company_id field which stores the id of the contact's company. Each subcontract has a company_id field which stores the subcontract's company. Each company has a company_id field which holds its guid and a primary_company field, b/c the company could be a subsidiary. If it's a subsidiary, the primary_company field holds the id of the primary company. I have a subcontract form. On the form, I have a drop-down of contacts which are stored in a contact table. Currently the drop-down lists all contacts. I would like to have the drop-down only list contacts which belong to the subcontract's company or any of that company's subsidiaries. I have the following query which I use elsewhere in the program to pass a company_id and get its subsidiaries. public IQueryable<company> GetSubsidiaryCompanies(Guid id) { return from c in db.companies where c.primary_company == id && c.active_status == true select c; } This is my current contact selection public IQueryable<contact> GetContacts() { return from c in db.contacts where c.active_status == true orderby c.contact_name select c; } What I need to do is pass it the subcontract.company_id and then only return the contacts where contact.company_id == subcontract.company_id or contact.company_id == one of the subsidiary ids.

    Read the article

  • xslt reading multiple instances of a tag

    - by shashank saket
    hello, my xml file is smth like this.. now in my xsl sheet i need to retrieve the values of all the "j.0:property" tags.. i am using something like this: </xsl:template> but then it returns the same value 3 times..the value being the value of the first property encountered.. kindly help as to how i can get the value for each property.

    Read the article

  • Fetch MP3 ID3 tag under linux

    - by exic
    Hi, I have a few mp3 files which are not tagged. Winamp has a nice feature which I think is called "autotag" and which is very good at finding out artist and title for files. I'd like something like this for unix, so that I could possibly get artists and titles for my untagged files. Do you know some program which does this? Thanks.

    Read the article

  • Oracle Insert via Select from multiple tables where one table may not have a row

    - by Mikezx6r
    I have a number of code value tables that contain a code and a description with a Long id. I now want to create an entry for an Account Type that references a number of codes, so I have something like this: insert into account_type_standard (account_type_Standard_id, tax_status_id, recipient_id) ( select account_type_standard_seq.nextval, ts.tax_status_id, r.recipient_id from tax_status ts, recipient r where ts.tax_status_code = ? and r.recipient_code = ?) This retrieves the appropriate values from the tax_status and recipient tables if a match is found for their respective codes. Unfortunately, recipient_code is nullable, and therefore the ? substitution value could be null. Of course, the implicit join doesn't return a row, so a row doesn't get inserted into my table. I've tried using NVL on the ? and on the r.recipient_id. I've tried to force an outer join on the r.recipient_code = ? by adding (+), but it's not an explicit join, so Oracle still didn't add another row. Anyone know of a way of doing this? I can obviously modify the statement so that I do the lookup of the recipient_id externally, and have a ? instead of r.recipient_id, and don't select from the recipient table at all, but I'd prefer to do all this in 1 SQL statement.

    Read the article

  • Rails multiple select box issue for search

    - by Reido
    First off here is my model, controller, view: My model, this is where I have my search code:--------------------------- def self.find_by_lcc(params) where = [] where << "category = 'Land'" unless params[:mls].blank? where << "mls = :mls" end unless params[:county].blank? where << "county = :county" end unless params[:acreage_range].blank? where << "acreage_range = :acreage_range" end unless params[:landtype].blank? where << "landtype = :landtype" end unless params[:price_range].blank? where << "price_range = :price_range" end if where.empty? [] else find(:all, :conditions => [where.join(" AND "), params], :order => "county, price desc") end end My controller:---------------- def land @counties = ['Adams', 'Alcorn', 'Amite', 'Attala'] @title = "Browse" return if params[:commit].nil? @properties = Property.find_by_lcc(params) else 'No properties were found' render :action = 'land_table' end My View: ---------------------- <table width="900"> <tr> <td> <% form_tag({ :action => "land" }, :method => "get") do %> <fieldset> <legend>Search our Land Properties</legend> <div class="form_row"><p>&nbsp;</p></div> <div class="form_row"> <label for="mls">MLS Number:</label>&nbsp; <%= text_field_tag 'mls', params[:mls] %> </div> <div class="form_row"> <label for "county"><font color="#ff0000">*County:</font></label>&nbsp; <%= select_tag "county", options_for_select(@counties), :multiple => true, :size => 6 %> </div> <div class="form_row"> <label for "acreage_range">Acreage:</label>&nbsp; <%= select_tag "acreage_range", options_for_select([['All',''],['1-10','1-10'],['11-25','11-25'],['26-50','26-50'],['51-100','51-100']]) %> </div> <div class="form_row"> <label for "landtype">Type:</label>&nbsp; <%= select_tag "landtype", options_for_select([['All',''],['Waterfront','Waterfront'],['Wooded','Wooded'],['Pasture','Pasture'],['Woods/Pasture','Woods/Pasture'],['Lot','Lot']]) %> </div> <div class="form_row"> <label for="price_range"><font color="#ff0000">*Price:</font></label>&nbsp; <%= select_tag "price_range", options_for_select([['All',''],['0-1,000','0-1,000'],['1,001-10,000','1,001-10,000'],['10,001-50,000','10,001-50,000'],['50,001-100,000','50,001-100,000'],['100,001-150,000']])%> </div> <input type="text" style="display: none;" disabled="disabled" size="1" /> <%= submit_tag "Search", :class => "submit" %> </fieldset> <% end%> </td> </tr> </table> The search works fine until I add ", :multiple = true, :size = 6" to make the county field multiple select. Then I get the error: Processing PublicController#land (for 65.0.81.83 at 2010-04-01 13:11:30) [GET] Parameters: {"acreage_range"=>"", "commit"=>"Search", "county"=>["Adams", "Amite"], "landtype"=>"", "price_range"=>"", "mls"=>""} ActiveRecord::StatementInvalid (Mysql::Error: Operand should contain 1 column(s): SELECT * FROM `properties` WHERE (category = 'Land' AND county = 'Adams','Amite') ORDER BY county, price desc): app/models/property.rb:93:in `find_by_lcc' app/controllers/public_controller.rb:84:in `land' /usr/lib/ruby/1.8/thread.rb:135:in `synchronize' fcgi (0.8.7) lib/fcgi.rb:117:in `session' fcgi (0.8.7) lib/fcgi.rb:104:in `each_request' fcgi (0.8.7) lib/fcgi.rb:36:in `each' dispatch.fcgi:24 I've tried to make the county, acreage_range, and price_range fields into multiple select boxes numerous ways, but can not get any method to work correctly. Any help would be greatly appreciated. Thanks,

    Read the article

  • Autopostback select lists in ASP.NET MVC using jQuery

    - by rajbk
    This tiny snippet of code show you how to have your select lists autopostback its containing form when the selected value changes. When the DOM is fully loaded, we get all select nodes that have an attribute of “data-autopostback” with a value of “true”. We wire up the “change” JavaScript event to all these select nodes. This event is fired as soon as the user changes their selection with the mouse.  When the event is fired, we find the closest form tag for the select node that raised the event and submit the form. $(document).ready(function () { $("select:[data-autopostback=true]").change(function () { $(this).closest("form").submit(); }); }); A select tag with autopostback enabled will look like this <select id="selCategory" name="Category" data-autopostback="true"> <option value='1'>Electronics</option> <option value='2'>Books</option> </select> The reason I am using “data-" suffix in the attribute is to be HTML5 Compliant. A custom data attribute is an attribute in no namespace whose name starts with the string "data-", has at least one character after the hyphen, is XML-compatible, and contains no characters in the range U+0041 to U+005A (LATIN CAPITAL LETTER A to LATIN CAPITAL LETTER Z). The snippet can be used with any HTML page.

    Read the article

  • Suggestions for html tag info required for jQuery Plugin

    - by Toby Allen
    I have written a tiny bit of jQuery which simply selects all the Select form elements on the page and sets the selected property to the correct value. Previously I had to write code to generate the Select in php and specify the Selected attribute for the option that was selected or do loads of if statements in my php page or smarty template. Obviosly the information about what option is selected still needs to be specified somewhere in the page so the jQuery code can select it. I decided to create a new attribute on the Select item <Select name="MySelect" SelectedOption="2"> <-- Custom Attr SelectedOption <option value="1">My Option 1 </option> <option value="2">My Option 2 </option> <-- this option will be selected when jquery code runs <option value="3">My Option 3 </option> <option value="4">My Option 4 </option> </Select> Does anyone see a problem with using a custom attribute to do this, is there a more accepted way, or a better jquery way?

    Read the article

  • Is title tag position relevant in html pages?

    - by webose
    I'd like know if having the title tag positioned at the end of <head> tag or in any other position, always inside the <head></head>, can lead to some kind of problem, I'm not talking about SEO stuffs, I'm talking about standards, browser rules, web application rules, or something like this. I'd like to load a page from two different php file like this, is it a wrong way? <!-- file1.php --> <html> <head> .... <!-- file2.php --> <title><?php echo($var)?> </head> <body> ... <head> tag is not closed, because with the second file I dynamically add the <title> tag.

    Read the article

  • To disallow indexing the category and tag listings in a blog

    - by Mert Nuhoglu
    Mark Wilson says that category and tag listings in a blog should be disallowed in order to prevent duplicate content. I understand this. However, I want to put internal links on keywords in the blog posts to the tag and category pages in order for the readers to find more relevant content. I wonder whether putting those internal links to the category/tag pages which are disallowed in robots.txt is counted as useful from the perspective of SEO internal linking?

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >