Search Results

Search found 12423 results on 497 pages for 'dynamic controls'.

Page 26/497 | < Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >

  • assigning selected="selected" to dynamic option list

    - by leemjac
    In an "edit article" page i have a select list which displays author first and last name, as well as authorId as the value. As well as the article context and headline and so on (fetched with a different method) - though this method also holds the authorId of the specific article. I need to have the Author of the Article selected in the option list, instead of it defaulting to the first option in the select list. what i have: echo''; //loop through author names in option list $authors_name foreach($authors_name as $nameRow){ echo'<option class="authorId" value = "' . $nameRow['AuthorID'] . '">'. $nameRow['FirstName'].' '.$nameRow['LastName'] .''; } echo'</select>'; and the jquery: var currID = ('#selectAuthor').val(); if(('.authorId').val() == currID){ $('.authorId').addClass('new_class') $('.new_class').prop('selected',true); } OR var currID = ('#selectAuthor').val(); if($("select option[value=currID]").attr('selected','selected')); Any help would be greatly appreciated, I hope what I am trying to do is clear. Thanks in advance I have simplified it with just regular input and checked it in jsfiddle.net here is the HTML '; <option value = "2">Name val 2</option> <option value = "5">Name val 5</option> <option value = "1">Name val 1</option> and here is the jquery var currID = $('#selectAuthor').val(); if($("select option[value='+currID+']").prop('selected',true));? and even then it doesn't apply selected="selected" to option with value="1"

    Read the article

  • help regarding dynamic redirect rule in htaccess

    - by user251336
    hi all, I need ur help for given subject. I am playing with htaccess rules first time in life. here is the scene - i want to redirect the urls - http://www.abc.com/var1 http://www.abc.com/var2 to follwing urls - http://www.abc.com/index.php?u=var1 http://www.abc.com/index.php?u=var2 In this case the values var1 & var2 can be anything (i.e. string which will contain only alphanumeric characters.) One more thing - I want to skip this rule if the url is - http://www.abc.com/SKIPME Please help me to write this rule! Regards, Shahu!

    Read the article

  • C++ multidimensional dynamic array

    - by dmessf
    Let's say I have this to create a multidimensional array dynamically: int* *grid = new int*[gridSizeX]; for (int i=0; i<gridSizeX; i++) { grid[i] = new int[gridSizeY]; } Shouldn't be possible now to access elements like grid[x][y] = 20?

    Read the article

  • Why I can't use template table in dynamic query SQL SERVER 2005

    - by StuffHappens
    Hello! I have the following t-sql code which generates an error Declare @table TABLE ( ID1 int, ID2 int ) INSERT INTO @table values(1, 1); INSERT INTO @table values(2, 2); INSERT INTO @table values(3, 3); DECLARE @field varchar(50); SET @field = 'ID1' DECLARE @query varchar(MAX); SET @query = 'SELECT * FROM @table WHERE ' + @field + ' = 1' EXEC (@query) The error is Must declare the table variable "@table". What's wrong with the query. How to fix it?

    Read the article

  • How to Develop Dynamic Plug-In Based Functionality in C#

    - by Matthew
    Hello: I've been looking around for different methods of providing plug-in support for my application. Ideally, I will be creating a core functionality and based on different customers developing different plug-ins/addons such as importing, exporting data etc... What are the some methods available for making a C# application extensible via a plug-in architecture? Lets make up an example. If we have a program that consists of a main menu ( File, Edit, View, et al. ) along with a TreeView that displays different brands of cars grouped by manufacturer ( Ford, GM, for now). Right clicking on a car displays a context menu with the only option being 'delete car'. How could you develop the application so that plug-ins could be deployed so that you could allow one customer to see a new brand in the TreeView, let's say Honda, and also extent the car context menu so that they may now 'paint a car'? In Eclipse/RCP development this is easily handled by extension points and plug-ins. How does C# handle it? I've been looking into developing my own plug-in architecture and reading up on MEF.

    Read the article

  • How to load dynamic events in Flex

    - by user309010
    Hi All, I have a small flex application. What I want to achieve is, I want my user to pass the script as a parameter. so he has the flexibility to do anything with the buttons-like add event, hide the other buttons. Something like this(below) <param name="script" value="import flash.events.Event;\n private function printMessage(event:Event):void {\nmessage.text += event.target.label + " pressed" + "\n";\n}"> Thanks.

    Read the article

  • Dynamic binary from file

    - by Aurel300
    This is a little bit of weird problem here. Say I have a C++ code, running on a specific platform. The only purpose of this code is to run files containing binary, NATIVE to that platform. Now - my question is - HOW would I get the data from these files (could even be by bits, like 1024 bits a cycle) to the memory of machine running my code so that this data would be in the execution part? In other words, can I get the data to somewhere where I can point the instruction pointer? If yes, how? I don't mind if I have to use assembler for this - just so it would work.

    Read the article

  • Validation error language in asp.NET dynamic data WEB-site

    - by loviji
    Hello, I need to change language of validation error to another language. Validation logic must not be changed. I just want to translate The field f5080eb8_0a83_4b89_b339_233528441711 must be a valid integer. into another language. For example from English into Italian. I search in my project for this text, result=0. So, what is the best way to translate validation error text into another language? Some ideas, thanks!

    Read the article

  • Live() keyword not working on load with dynamic html images

    - by Sara Chipps
    I have images being dynamically added to a page, I don't seem to be able to get the 'load' event working dynamically with live(). This is the code I currently have: $('#largeImg' + nextUniqueItemID).hide(); $('#largeImg' + nextUniqueItemID).live('load' , function() { $('#loader' + nextUniqueItemID).hide(); $('#largeImg' + nextUniqueItemID).show(); }); with '#largeImg' + nextUniqueItemID being an image that was added to the page earlier in the function and '#largeImg' + nextUniqueItemID being a loading image. I feel as if I may be misusing "live" as it doesn't really need a listener but to trigger the event immediately.

    Read the article

  • How to create dynamic textfield based on radio button's input

    - by qdog
    I am trying to get a form's textfield to dynamically appear based on a radio checkbox selection. For example, on my form...there is a radio button that ask "Do you want to enter your age?" with an option to check YES or NO. If the user check YES, a textfield dynamically appear after this so the the user can enter his or her age. If user check NO, then nothing happen. How do I begin to do something like this? Just looking for any feedback I can get. Thanks!

    Read the article

  • How to build a dynamic resize-able Flash player

    - by Leon
    Morning stackers! So my question today isn't dealing with any code, but how to go about this the correct way from the start. I have a video player built to a static size (max: 800x600) which I'll have to re-code every time I need it to be a different size. What I need it to do in the near future is dynamically resize itself and all the elements inside of it based on 1 width variable that it will received either from HTML or XML. Now to me there are 2 ways to go about this: Start with the smallest size possible and resize upwards, but I'm unsure of how the Flash movie will actually expand upwards as of right now. Or 2, start with the largest size possible (in this case 800x600) and size everything down. Step 1, I think seems to be the better way to go about this (ala YouTube style), but Step 2 also seems like it could be the easier way? A friend of mine mentioned that I should go with the larger size and have elements resize in each class, then fix to the upper left hand corner. However for the player to fit inside of certain div columns on sites, blogs whatever he said that there will have to be an HTML/CSS side of this... meaning that the div containing the resized flash player will have to cover up the areas of the Flash movie that are not to be shown? Is that possible to put a 800x600 flash movie into a div that smaller then 800 pixels wide? And cover it up with another div? Anyways, my mission is to be able to have a dynamically sized player like this: Thoughts? Recommendations? Best practices for this before I start?

    Read the article

  • How to use JQuery to remove dynamic content?

    - by ed.talmadge
    I have an html page that is generated by a CMS. I cannot modify the page, but can add JavaScript. Each time the page loads, a JavaScript function (that I cannot modify) dynamically inserts a paragraph onto the page. How can I use JQuery to .remove() that paragraph whenever it is loaded? For example, when the page first loads, it look like this (blank): <div></div> Then, a few seconds later, a JavaScript function (that I have no control over) adds a paragraph to the page. The page then looks like this: <div><p id="foo">bar</p></div> How can I use JQuery to remove the paragraph with id=foo each time it is dynamically loaded onto the page?

    Read the article

  • Dynamic change .click value Jquery IE issue.

    - by user326100
    Hello guys.. it's i first time i'm asking here. Sorry if the answer is available already. I have a very small jQuery script that canges the paramether for onclick attr on a DIV. IT works like as right and left arrows for some content in the middle. BAsically i set the onclick="foo(1)" then when get clicked sld change the value 1 to 2, and keep changing everytime i click. on jQuery functio i'm using: $("#v_arrow_r").attr('onclick','').unbind().click(newclick_next); it works like a charm on FF and Chrome, but does not work on IE !!!! Argh... here the the code: if (start == 24) { var a = 0; var b = 0; } else { var a = start-6; var b = start+6; } next = "home_featured_videos(" + b + ");"; newclick_next = eval("(function(){"+next+"});"); prev = "home_featured_videos(" + a + ");"; newclick_prev = eval("(function(){"+prev+"});"); $('#video-module').css('background',''); $('#video-module').html(response); $("#v_arrow_l").attr('onclick','').unbind().click(newclick_prev); $("#v_arrow_r").attr('onclick','').unbind().click(newclick_next); The html: //CONTENT So like i said.. i define the attr onclick when page open. It work well on IE. but when i click the arrow and call the function the oncli is set to null and i add the function to .click. IE stop working. the click is dead. If anybody have idea why this is happening. Thanx in advance. Kind Regards Varois

    Read the article

  • Making dynamic images have static filenames

    - by michaeltk
    My website currently has various links to a php script that generates the images dynamically. For example, the link may say "img source="/dynamic_images.php?type=pie-chart&color=red" Obviously, this is not great for SEO. I'd like to somehow make the filenames of these links appear to be static, and use a solution (like Mod-Rewrite) to ensure that the images can still be dynamically created. I suppose I could have something like "img src="average-profits-in-scuba-diving-industry.png?type=pie-chart&color=red" (and use Mod-Rewrite to take care of changing the filename prefix to dynamic_images.php), but I'm afraid that the search engines would shy away from the querystring on the end of the image filename. Any solutions? Thanks in advance.

    Read the article

  • android webview returns blank page when load dynamic html page

    - by user2962555
    I am trying to click one button to load a page into a div block dynamically. To test it, I try to append a list item with text "abc" into the loaded page. However, I always get a blank page. load function works fine because if I try to load a static page, it works. Following is my main html page code. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>LoadPageTest</title> <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,700"> <link rel="stylesheet" href="./css/customizedstyle.css"> <link rel="stylesheet" href="./css/themes/default/jquery.mobile-1.4.3.min.css"> <link rel="stylesheet" href="./css/jqm-demos.css"> <script src="./js/jquery.js"></script> <script scr="./js/customizedjs.js"></script> <script src="./js/jquery.mobile-1.4.3.min.js"></script> <script> $( document ).on( "pagecreate", "#demo-page", function() { $( document ).on( "swipeleft swiperight", "#demo-page", function( e ) { if ( $( ".ui-page-active" ).jqmData( "panel" ) !== "open" ) { if ( e.type === "swipeleft" ) { $( "#right-panel" ).panel( "open" ); } } }); }); </script> <style type="text/css"> body { overflow:hidden; } </style> </head> <body style= "overflow:hidden" scrolling="no"> <style type="text/css"> body { overflow:hidden; } </style> <div data-role="page" id="main-page" style= "overflow:hidden" scrolling="no"> <div role="main" class="ui-content" id ="maindiv" style= "overflow: auto"> Will load diff pages here. </div><!-- /content --> <div data-role="panel" id="left-panel" data-theme="b"> <ul data-role="listview" data-icon="false" id="menu"> <li> <a href="#" id = "btnA" data-rel="close">Go Page A <img src="./images/icona.png" class="ui-li-thumb"/> </li> <li> <a href="#" id = "btnB" data-rel="close">Go Page B <img src="./images/iconb.png" class="ui-li-thumb"/> </li> </ul> </div><!-- /panel --> <script type="text/javascript"> $("#btnA").on("click", function(){ $("#maindiv").empty(); $("#maindiv").load("pageA.html"); }); $("#btnB").on("click", function(){ $("#maindiv").empty(); $("#maindiv").load("pageB.html"); }); </script> </div><!-- /page --> </body> </html> Next is code for the page I try to load dynamically. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Page should be loaded</title> <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,700"> <link rel="stylesheet" href="./css/customizedstyle.css"> <link rel="stylesheet" href="./css/themes/default/jquery.mobile-1.4.3.min.css"> <link rel="stylesheet" href="./css/jqm-demos.css"> <script src="./js/jquery.js"></script> <script scr="./js/customizedjs.js"></script> <script src="./js/jquery.mobile-1.4.3.min.js"></script> <script> $(document).on('pagebeforeshow', function () { $('#postlist').append('<li> abc </li>'); $('#postlist').listview('refresh'); }); </script> </head> <body > <div data-role="page" id="posthome"> <div data-role = "content"> <ul data-role='listview' id = "postlist"> </ul> </div> </div> </body> </html> I doubt if it is because my javascript in the page doesn't work, cause the swipe js code in the main page seems not work either. Is that possible? I have enabled javascript in the onCreate() function of the activity file as below. protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_message); new LongRunningGetIO().execute(); mWebView = (WebView) findViewById(R.id.webview); mWebView.setWebViewClient(new AppClient()); mWebView.setVerticalScrollBarEnabled(false); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.getSettings().setDomStorageEnabled(true); mWebView.loadUrl("file:///android_asset/index.html"); } I noticed there is a warning for statement to enable javascript "Using setJavaScriptEnabled can introduce XSS vulnerabilities into you application, review carefully". Will that maybe the reason? Then, I added @SuppressLint("SetJavaScriptEnabled") on top of the activity. The warning is gone, but the js code in pages seem still not work.

    Read the article

  • Drupal Webform textfield dynamic growing list

    - by Bob Crowley
    Just curious... I have a project where people can input their cooking recipes. I would like to build a webform that will have a textfield and when it is filled in a new textfield appears below. A "growing textfield list". Let me try to show it here: Ingredient #1 _________________________________ [add] When you type and ingredient click "add" you then are going to see: Ingredient #1 Potatoes_________________________ Ingredient #2 _________________________________ [add] Sorry for not knowing the proper markup. However if anyone knows: a) the proper term for this ( I call a growing textfield list )? b) how to do it with webform in drupal?

    Read the article

  • Dynamic columns in C# rdlc report

    - by Mugume David
    Suppose I have a report that lists employees (as rows) with their respective taxes charged (in columns). It is possible for a new tax to come up. Since my rdlc report file is currently designed (from XML of-course) to statically generate the coulumns. A future shift in events will need me to alter the rdlc file and add in a new column. how can i do this dynamically. I intend to avoid opening the rdlc file and adding XML code.

    Read the article

  • ExtJS (4.0) dynamic / lazy loading

    - by Paul
    Given a border layout with a west (navigation) and a center region. Let say I click on topic A in the west region, I want to replace (replace as in 'delete last topic') the center region with 'extjs' program code named topic_a.js I succeed in loading with this code: dynamicPanel = new Ext.Component({ loader: { url: '/www/file.htm', renderer: 'html', autoLoad: true, scripts: true } }); var oMainContainer = Ext.getCmp('maincontainer'); oMainContainer.show(); oMainContainer.add(dynamicPanel); But calling this the second time 'adds' things up in the center region and of course fails short in 'deleting', what would be a good approach?

    Read the article

  • Rails - Dynamic name routes namespace

    - by Kuro
    Hi, Using Rails 2.3, I'm trying to configure my routes but I uncounter some difficulties. I would like to have something like : http:// mydomain.com/mycontroller/myaction/myid That should respond with controllers in :front namespace http:// mydomain.com/aname/mycontroller/myaction/mydi That should respond with controllers in :custom namespace I try something like this, but I'm totaly wrong : map.namespace :front, :path_prefix => "" do |f| f.root :controller => :home, :action => :index f.resources :home ... end map.namespace :custom, :path_prefix => "" do |m| m.root :controller => :home, :action => :index m.resources :home ... m.match ':sub_url/site/:controller/:action/:id' m.match ':sub_url/site/:controller/:action/:id' m.match ':sub_url/site/:controller/:action/:id.:format' m.match ':sub_url/site/:controller/:action.:format' end I put matching instruction in custom namespace but I'm not sure it's the right place for it. I think I really don't get the way to customize fields in url matching and I don't know how to find documentation about Rails 2.3, most of my research drove me to Rails 3 doc about the topic... Somebody to help me ?

    Read the article

  • how to create a dynamic class at runtime in Java

    - by Mrityunjay
    hi, is it possible to create a new java file from existing java file after changing some of its attributes at runtime?? Suppose i have a java file pubic class Student{ private int rollNo; private String name; // getters and setters // constructor } is it possible to create something like this, provided that rollNo is key element for the table.. public class Student { private StudentKey key; private String name; //getters and setters //constructor } public class StudentKey { private int rollNo; // getters and setters // construcotors } please help..

    Read the article

  • C++ dynamic array sizing problem

    - by Peter
    The basic pseudo code looks like this: void myFunction() { int size = 10; int * MyArray; MyArray = new int[size]; cout << size << endl; cout << sizeof(MyArray) << endl; } The first cout returns 10, as expected, while the second cout returns 4. Anyone have an explanation?

    Read the article

  • Dynamic SQL and Funtions

    - by Unlimited071
    Hi all, is there any way of accomplishing something like the following: CREATE FUNCTION GetQtyFromID ( @oricod varchar(15), @ccocod varchar(15), @ocmnum int, @oinnum int, @acmnum int, @acttip char(2), @unisim varchar(15) ) AS BEGIN DECLARE @Result decimal(18,8) DECLARE @SQLString nvarchar(max); DECLARE @ParmDefinition nvarchar(max); --I need to execute a query stored in a cell which returns the calculated qty. --i.e of AcuQry: select @cant = sum(smt) from table where oricod = @oricod and ... SELECT @SQLString = AcuQry FROM OinActUni WHERE (OriCod = @oricod) AND (ActTipCod = @acttip) AND (UniSim = @unisim) AND (AcuEst > 0) SET @ParmDefinition = N' @oricod varchar(15), @ccocod varchar(15), @ocmnum int, @oinnum int, @acmnum int, @cant decimal(18,8) output'; EXECUTE sp_executesql @SQLString, @ParmDefinition, @oricod = @oricod, @ccocod = @ccocod, @ocmnum = @ocmnum, @oinnum = @oinnum, @acmnum = @acmnum, @cant = @result OUTPUT; RETURN @Result END The problem with this approach is that it is prohibited to execute sp_excutesql in a function... What I need is to do something like: select id, getQtyFromID(id) as qty from table The main idea is to execute a query stored in a table cell, this is because the qty of something depends on it's unit. the unit can be days or it can be metric tons, so there is no relation between the units, therefore the need of a specific query for each unit.

    Read the article

  • Dynamic programming Approach- Knapsack Puzzle

    - by idalsin
    I'm trying to solve the Knapsack problem with the dynamical programming(DP) approach, with Python 3.x. My TA pointed us towards this code for a head start. I've tried to implement it, as below: def take_input(infile): f_open = open(infile, 'r') lines = [] for line in f_open: lines.append(line.strip()) f_open.close() return lines def create_list(jewel_lines): #turns the jewels into a list of lists jewels_list = [] for x in jewel_lines: weight = x.split()[0] value = x.split()[1] jewels_list.append((int(value), int(weight))) jewels_list = sorted(jewels_list, key = lambda x : (-x[0], x[1])) return jewels_list def dynamic_grab(items, max_weight): table = [[0 for weight in range(max_weight+1)] for j in range(len(items)+1)] for j in range(1,len(items)+1): val= items[j-1][0] wt= items[j-1][1] for weight in range(1, max_weight+1): if wt > weight: table[j][weight] = table[j-1][weight] else: table[j][weight] = max(table[j-1][weight],table[j-1][weight-wt] + val) result = [] weight = max_weight for j in range(len(items),0,-1): was_added = table[j][weight] != table[j-1][weight] if was_added: val = items[j-1][0] wt = items[j-1][1] result.append(items[j-1]) weight -= wt return result def totalvalue(comb): #total of a combo of items totwt = totval = 0 for val, wt in comb: totwt += wt totval += val return (totval, -totwt) if totwt <= max_weight else (0,0) #required setup of variables infile = "JT_test1.txt" given_input = take_input(infile) max_weight = int(given_input[0]) given_input.pop(0) jewels_list = create_list(given_input) #test lines print(jewels_list) print(greedy_grab(jewels_list, max_weight)) bagged = dynamic_grab(jewels_list, max_weight) print(totalvalue(bagged)) The sample case is below. It is in the format line[0] = bag_max, line[1:] is in form(weight, value): 575 125 3000 50 100 500 6000 25 30 I'm confused as to the logic of this code in that it returns me a tuple and I'm not sure what the output tuple represents. I've been looking at this for a while and just don't understand what the code is pointing me at. Any help would be appreciated.

    Read the article

  • Managing many draw calls for dynamic objects

    - by codetiger
    We are developing a game (cross-platform) using Irrlicht. The game has many (around 200 - 500) dynamic objects flying around during the game. Most of these objects are static mesh and build from 20 - 50 unique Meshes. We created seperate scenenodes for each object and referring its mesh instance. But the output was very much unexpected. Menu screen: (150 tris - Just to show you the full speed rendering performance of 2 test computers) a) NVidia Quadro FX 3800 with 1GB: 1600 FPS DirectX and 2600 FPS on OpenGL b) Mac Mini with Geforce 9400M 256mb: 260 FPS in OpenGL Now inside the game in a test level: (160 dynamic objects counting around 10K tris): a) NVidia Quadro FX 3800 with 1GB: 45 FPS DirectX and 50 FPS on OpenGL b) Mac Mini with Geforce 9400M 256mb: 45 FPS in OpenGL Obviously we don't have the option of mesh batch rendering as most of the objects are dynamic. And the one big static terrain is already in single mesh buffer. To add more information, we use one 2048 png for texture for most of the dynamic objects. And our collision detection hardly and other calculations hardly make any impact on FPS. So we understood its the draw calls we make that eats up all FPS. Is there a way we can optimize the rendering, or are we missing something?

    Read the article

< Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >