Search Results

Search found 148 results on 6 pages for 'chained'.

Page 1/6 | 1 2 3 4 5 6  | Next Page >

  • javascript - multiple dependent/cascading/chained select boxes on same form

    - by Aaron
    I'm populating select box options via jquery and json but I'm not sure how to address multiple instances of the same chained select boxes within my form. Because the select boxes are only rendered when needed some records will have ten sets of chained select boxes and others will only need one. How does one generate unique selects to support the auto population of secondary select options? Here's the code I'm using, and I thank you in advance for any insight you may provide. <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> function populateACD() { $.getJSON('/acd/acd2json.php', {acdSelect:$('#acdSelect').val()}, function(data) { var select = $('#acd2'); var options = select.attr('options'); $('option', select).remove(); $.each(data, function(index, array) { options[options.length] = new Option(array['ACD2']); }); }); } $(document).ready(function() { populateACD(); $('#acdSelect').change(function() { populateACD(); }); }); </script> <?php require_once('connectvars.php'); $dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); $squery = "SELECT ACD1ID, ACD1 from ACD1"; $sdata = mysqli_query($dbc, $squery); // Loop through the array of ACD1s, placing them into an option of a select echo '<select name="acdSelect" id="acdSelect">'; while ($row = mysqli_fetch_array($sdata)) { echo "<option value=" . $row['ACD1ID'] . ">" . $row['ACD1'] . "</option>\n"; } echo '</select><br /><br />'; <select name="acd2" id="acd2"> </select> acd2json.php <?php $dsn = "mysql:host=localhost;dbname=wfn"; $user = "acd"; $pass = "***************"; $pdo = new PDO($dsn, $user, $pass); $rows = array(); if(isset($_GET['acdSelect'])) { $stmt = $pdo->prepare("SELECT ACD2 FROM ACD2 WHERE ACD1ID = ? ORDER BY ACD2"); $stmt->execute(array($_GET['acdSelect'])); $rows = $stmt->fetchAll(PDO::FETCH_ASSOC); } echo json_encode($rows); ?>

    Read the article

  • chained msi's/Bootstrapper/prerequisite?

    - by MzTyla
    I have a few component msi packages that need to installed together to form the end application. The problem is: the components that make up the package can be updated and the component relaunched on the http file server.What approach should i take? The installer that i am writing is the 'master' installer. Which needs to be able to read what version of each component is installed on ther client machine in order to perform an upgrade only on that one component. Also if the application is installed for the first time the installer will download and install all required components. I am using Installshield 2009. I have looked into chained MSI's but the master installer is empty. as it needs to be as lightweight as possible. I have no idea how to write a bootstrapper application and my company perfers that i use installshield to write the installer. I have researched - and apparently pre-requisites are not meant to be uninstalled.

    Read the article

  • Apply jquery selectbox style on chained selectbox

    - by ktsixit
    Hi all, I have created a pair of chained selectboxes in my page. The second selectbox is filled with a set of values, depending on the first box's selected value. The script that makes the two selectboxes work like this, uses php and javascript. This is the code I'm using: form <select name="continent" tabindex="1" onChange="getCountry(this.value)"> <option value="#">-Select-</option> <option value="Europe">Europe</option> <option value="Asia">Asia</option> </select> <div id="countrydiv"> <select name="country" tabindex="2"> <option></option> </select> </div> <input type="submit" /> </form> javascript code $(document).ready(function() { $('select[name="continent"]').selectbox({debug: true}); $('select[name="country"]').selectbox({debug: true}); }); function getXMLHTTP() { //fuction to return the xml http object var xmlhttp=false; try{ xmlhttp=new XMLHttpRequest(); } catch(e) { try{ xmlhttp= new ActiveXObject("Microsoft.XMLHTTP"); } catch(e){ try{ xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e1){ xmlhttp=false; } } } return xmlhttp; } function getCountry(continentId) { var strURL="findCountry.php?continent="+continentId; var req = getXMLHTTP(); if (req) { req.onreadystatechange = function() { if (req.readyState == 4) { // only if "OK" if (req.status == 200) { document.getElementById('countrydiv').innerHTML=req.responseText; } else { alert("There was a problem while using XMLHTTP:\n" + req.statusText); } } } req.open("GET", strURL, true); req.send(null); } } php code (findCountry.php) <? $continent=intval($_GET['continent']); if ($_GET['continent'] == 'Europe') { ?> <select name="country"> <option value="France">France</option> <option value="Germany">Germany</option> <option value="Spain">Spain</option> <option value="Italy">Italy</option> </select> <? } if ($_GET['continent'] == 'Asia') { ?> <select name="country"> <option value="China">China</option> <option value="India">India</option> <option value="Japan">Japan</option> </select> <? } ?> What I want to do is to apply jquery selectbox styling on these selectboxes. I haven't succeeded in doing that yet. The problem is that jquery is hiding the normal selectbox and is replacing it with a list. Furthermore, after selectbox's content is refreshed, jquery cannot re-construct it into a list. You can take a look of the jquery code here Is there something I can do to combine these techniques? I have tried a million things but nothing worked. Can you please help me?

    Read the article

  • jQuery clone chained selects

    - by Volkaria
    I just started from: http://jsfiddle.net/FJFFJ/1/ (by Chain dynamically created dropdowns with JQuery) It's really good but now I need to change a bit: clone the last group of selects. ie.: +- Argentina | San Juan | Rawson Chile | Santiago | Chiñihue Then, if I click at "+", it will clone Chile | Santiago | Chiñihue instead of the first one. Can someone help, please? Thanks on Advance!

    Read the article

  • Creating a chained dropdownlist using AJAX and XML

    This article is about to create a chained drop down list when we need to represent data from hierarchical data sets. Here I’ll be discussing the method to populate ASPX dropdown lists using partial page rendering with AJAX. My database is simple XML data file.

    Read the article

  • Creating a chained dropdownlist using AJAX and XML

    This article is about to create a chained drop down list when we need to represent data from hierarchical data sets. Here Ill be discussing the method to populate ASPX dropdown lists using partial page rendering with AJAX. My database is simple XML data file....Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • File system with chained clusters

    - by Maki Maki
    I'm trying to create school file system with partitions on disks, every partition has its cluster for her representation. typedef unsigned long ClusterNo; const unsigned long ClusterSize = 2048; int x, y ;//x ,y are entries for two-chained lists of clusters if (endOfFile<maxsize// { ... { pointer = KernelFS::searchFreeCluster(partitionPointer->letter) " How can I initialize the beginning for two clusters, their pointers to be 32 bits?

    Read the article

  • Create new variable or make multiple chained calls?

    - by Rodrigo
    What is the best way to get this attributes, thinking in performance and code quality? Using chained calls: name = this.product.getStock().getItems().get(index).getName(); id = this.product.getStock().getItems().get(index).getId(); Creating new variable: final item = this.product.getStock().getItems().get(index); name = item.getName(); it = item.getId(); I prefer the second way, to let the code cleaner. But I would like to see some opinions about it. Thank you!

    Read the article

  • Set secondary receiver in PayPal Chained Payment after the initial transaction

    - by CJxD
    I'm running a service whereby customers seek the services of 'freelancers' through our web platform. The customer will make a 'bid' which is immediately taken from their accounts as security. Once the job is completed, the customer marks it as accepted and the bid gets distributed to the freelancer(s) as a reward. After initially storing these rewards in the accounts of the freelancers and relying on MassPay to sort out paying them later, I realised that your business needs to be turning over at least £5000/month before MassPay is switched on. Instead, I was referred to Delayed Chained Payments in PayPal's Adaptive Payments API. This allows the customer to pay the primary receiver (my business) before the payment is later triggered to be sent to the secondary receivers (the freelancers). However, at the time that the customer initiates this transaction, you must understand that nobody yet knows who will receive the reward. So, before I program this whole Adaptive Payments system, is it even possible to change or add the secondary receivers after the customer has paid? If not, what can I do?

    Read the article

  • Is there a design pattern for chained observers?

    - by sharakan
    Several times, I've found myself in a situation where I want to add functionality to an existing Observer-Observable relationship. For example, let's say I have an Observable class called PriceFeed, instances of which are created by a variety of PriceSources. Observers on this are notified whenever the underlying PriceSource updates the PriceFeed with a new price. Now I want to add a feature that allows a (temporary) override to be set on the PriceFeed. The PriceSource should still update prices on the PriceFeed, but for as long as the override is set, whenever a consumer asks PriceFeed for it's current value, it should get the override. The way I did this was to introduce a new OverrideablePriceFeed that is itself both an Observer and an Observable, and that decorates the actual PriceFeed. It's implementation of .getPrice() is straight from Chain of Responsibility, but how about the handling of Observable events? When an override is set or cleared, it should issue it's own event to Observers, as well as forwarding events from the underlying PriceFeed. I think of this as some kind of a chained observer, and was curious if there's a more definitive description of a similar pattern.

    Read the article

  • Chained MSI Installers Tool

    - by JoelHess
    I'm looking for a tool (preferably not InstallShield, and also preferably cheap/Free) that supports Chained MSI Installations. I've got several small installations that need to be able to be deployed separately, but also as one group, and I'd like to not have to maintain multiple installers. It looks like I need Windows Installer 4.5 to do this properly, but I can't seem to find to much info when I'm looking around for what version of Installer is supported.

    Read the article

  • Checking if file exist with RewriteCond in a chained RewriteRule

    - by gelilloabad
    Hello, I hope you could help me here. I have a RewriteRule which gives you a crossdomain.xml file depending on the domain name. I have it in a way that ignores the ".dev." string in the middle, example: Request: http://site1.dev.mydomain.com/crossdomain.xml Returns file: /etc/httpd/conf/crossdomain/site.mydomain.com.xml RewriteCond %{HTTP_HOST} "^(.*)\.dev\.(.*)" RewriteCond %{REQUEST_URI} "/crossdomain.xml" enter code hereRewriteRule ^(.+) %{HTTP_HOST}$1 [C] RewriteRule ^(.*)\.dev\.([^/]*)/crossdomain.xml /etc/httpd/conf/crossdomain/$1.$2.xml [L] Question: How do I check if the file exists? I tried adding this on top but it doesn't work: RewriteCond /etc/httpd/conf/crossdomain/$1.$2.xml -f I guess because it is a chained rule, no idea. Please help.

    Read the article

  • Chained inequality notation in programming languages

    - by Davorin
    Is there a programming language that supports chained notation a < b < c to be used instead of a < b and b < c in conditional statements? Example: if ( 2 < x < 5 ) if ( 2 < x && x < 5 ) First statementlooks better to me, it's easier to understand and the compiler could use transitivity property to warn about mistakes (e.g. 5 < x < 2 would give a warning).

    Read the article

  • Evaluating Django Chained QuerySets Locally

    - by jnadro52
    Hello All: I am hoping someone can help me out with a quick question I have regarding chaining Django querysets. I am noticing a slow down because I am evaluating many data points in the database to create data trends. I was wondering if there was a way to have the chained filters evaluated locally instead of hitting the database. Here is a (crude) example: pastries = Bakery.objects.filter(productType='pastry') # <--- will obviously always hit DB, when evaluated cannoli = pastries.filter(specificType='cannoli') # <--- can this be evaluated locally instead of hitting the DB when evaluated, as long as pastries was evaluated? I have checked the docs and I do not see anything specifying this, so I guess it's not possible, but I wanted to check with the 'braintrust' first ;-). BTW - I know that I can do this myself by implementing some methods to loop through these datapoints and evaluate the criteria, but there are so many datapoints that my deadline does not permit me manually implementing this. Thanks in advance.

    Read the article

  • iPhone: Chained views

    - by Michael
    I want to have dynamically created views and be able to scroll(change views like in camera roll) either from my program or user should also be able to do that. The views should contain only a simple text. Each view has to replace other, so they are like chained. The other example is the screenshots of applications in app store application details. I don't know which classes to check/start so if anyone can give me an idea of how this could be designed I would appreciate it.

    Read the article

  • PHP: Prevent chained method from returning?

    - by Industrial
    Hi, I am having some headaches regarding method chaining for a quite simple PHP class that returns a value, which sometimes need to go through a decryption process: $dataset = new Datacontainer; $key = $dataset->get('key'); $key2 = $dataset->get('key')->decrypt(); The get method is where the return lives. So the call to the decrypt method on the second row isn't going to work in its current state. Can I do something to setup the get method to return only when nothing is chained to it, or what would be the best way to re-factor this code?

    Read the article

  • Sqlite3 "chained" query

    - by Arrieta
    I need to create a configuration file from a data file that looks as follows: MAN1_TIME '01-JAN-2010 00:00:00.0000 UTC' MAN1_RX 123.45 MAN1_RY 123.45 MAN1_RZ 123.45 MAN1_NEXT 'MAN2' MAN2_TIME '01-MAR-2010 00:00:00.0000 UTC' MAN2_RX 123.45 [...] MAN2_NEXT 'MANX' [...] MANX_TIME [...] This file describes different "legs" of a trajectory. In this case, MAN1 is chained to MAN2, and MAN2 to MANX. In the original file, the chains are not as obvious (i.e., they are non-sequential). I've managed to read the file and store in an Sqlite3 database (I'm using the Python interface). The table is stored with three columns: Id, Par, and Val; for instance, Id='MAN1', Par='RX', and Val='123.45'. I'm interested in querying such database for obtaining the information related to 'n' legs. In English, that would be: "Select RX,RY,RZ for the next five legs starting on MAN1" So the query would go to MAN1, retrieve RX, RY, RZ, then read the parameter NEXT and go to that Id, retrieve RX, RY, RZ; read the parameter NEXT; go to that one ... like this five times. How can I pass such query with "dynamic parameters"? Thank you.

    Read the article

  • jQuery AJAX chained calls + Celery in Django

    - by user1029968
    Currently clicking one of the links in my application, triggers AJAX call (GET) that - if succeeds - triggers the second one and this second one - if succeeds - calls the third one. This way user can be informed which part of process started when clicking the link is currently ongoing. So in the template file in Django project, click callback body for link mentioned looks like below: $("#the-link").click(function(item)) { // CALL 1 $.ajax({ url: {% url ajax_call_1 %}, data: { // something } }) .done(function(call1Result) { // CALL 2 $.ajax({ url: {% url ajax_call_1 %}, data: { // call1Result passed here to CALL 2 } }) .done(function(call2Result) { // CALL 3 $.ajax({ url: {%url ajax_call_3 %}, data: { // call2Result passed here to CALL 3 } }) .done(function(call3Result) { // expected result if everything went fine console.log("wow, it worked!"); console.log(call3Result); }) .fail(function(errorObject) { console.log("call3 failed"); console.log(errorObject); } }) .fail(function(errorObject)) { console.log("call2 failed"); console.log(errorObject); } }) .fail(function(errorObject) { console.log("call1 failed"); console.log(errorObject); }); }); This works fine for me. The thing is, I'd like to prevent interrupting the following calls if the user closes the browser and the calls are not finished (as it will take some time to finish all three), as there is some additional logic in Django view functions called in each GET request. For example, if user clicks the link and closes the browser during CALL 1, is it possible to somehow go on with the following CALL 2 and CALL 3? I know that normally I'd be able to use Celery Task to process the function but is it still possible here with the chained calls mentioned? Any help is much appreciated!

    Read the article

  • paypal_adaptive gem in Rails: Dynamic Receiver "Population" (Chained Payments)

    - by Jmlevick
    Note: I didn't find a better title for this O.o Hello, Humm... Look, what I want to do is to have a Rails app where a visitor can click a button/link to make a "special" chained payment using Paypal; Currently I have a Users registration form that has one field for the user to enter his/her paypal account email, and as I saw here: http://marker.to/XGg9MR it is possible to specify the primary reciever and the secondary ones by adding such info in a controller action when using the paypal_adaptive gem in a rails app. The thing is, I don't want to hard code the secondary reciever as I need to specify a different secondary reciever from time to time, (being specific my primary reciever will always be the same, but depending on what button/link the visitor clicks, the secondary one is going to change) and I want that secondary reciever email to be the paypal e-mail account from one of the registered users when the visitor clicks on their specific button/link... My question is: Is it possible to create such enviroment functionality in my app using the current implementation of the paypal_adaptive gem? Could someone point me in the right direction on how to accomplish such thing? I'm still learning rails and also I'm really new in the paypal handling universe with this framework! XD P.S. Thanks! :)

    Read the article

  • chained selects with one table

    - by Owen
    I know I am going about this in an unusual way, every tut I've seen uses multiple tables, but due to the way the rest of my site works I would like to create a chained select which operates using a single table. My table structure is: ---------------------- |Catagory|SubCategory| |01|cat1 |subcat1 | |02|cat1 |subcat2 | |03|cat2 |subcat1 | |04|cat2 |subcat2 | ---------------------- The code I have so far looks like: <tr> <td class="shadow"><strong>Category:</strong> </td> <td class="shadow"> <select id="category" name="category" style="width:150px"> <option selected="selected" value="<?php echo $category ?>"><?php echo $category?></option> <?php include('connect.php'); $result1 = mysql_query("SELECT DISTINCT category FROM categories") or die(mysql_error()); while($row = mysql_fetch_array( $result1 )) { $category = $row['category']; echo "<option value='". $row['category'] ."'>". $row['category'] ."</option>"; } ?> </select> </td> </tr> <tr> <td class="shadow"><strong>Sub Category:</strong> </td> <td class="shadow"> <select id="sub_catgory" name="sub_category" style="width:150px;"> <option selected="selected" value="<?php echo $sub_category ?>"><?php echo $sub_category ?></option> <?php include('connect.php'); $result2 = mysql_query("SELECT sub_category FROM categories WHERE ") or die(mysql_error()); while($row = mysql_fetch_array ($result2 )){ echo "<option value='" . $row['sub_category'] . "'>". $row['sub_category']. "</option>"; } ?> </select> </td> </tr> On the second select I am not sure how to state the WHERE clause. I need it to display the subcategories which have the same category as selected in the first select. PART 2 how would I include AJAX in this to preload the data so i don't need to refresh the page. Could someone either help me finish what I've started here or point me to a good tutorial. thanks

    Read the article

  • codeigniter mulitple LIKE db query using associative array- but all from the same column name...?

    - by Inigo
    Hi, I'm trying to query my database using codeigniter's active record class. I have a number of blog posts stored in a table. The query is for a search function, which will pull out all the posts that have certain categories assigned to them. So the 'category' column of the table will have a list of all the categories for that post in no particular order, separated by commas, like so: Politics,History,Sociology.. etc. If a user selects, say, Politics and History, The titles of all the posts that have BOTH these categories should be returned. Right? So, the list of categories queried will be the array $cats. I thought this would work- foreach ($cats as $cat){ $this->db->like('categories',$cat); } By Producing this- $this-db-like('categories','Politics'); $this-db-like('categories','History'); (Which would produce- 'WHERE categories LIKE '%Politics%' AND categories LIKE '%History%') But it doesn't work, it seems to only produce the first statement. The problem I guess is that the column name is the same for each of the chained queries. There doesn't seem to be anything in the CI user guide about this (http://codeigniter.com/user_guide/database/active_record.html) as they seem to assume that each chained statement is going to be for a different column name. Does anyone know how I could do this? Thanks! edit- Of course it is not possible to use an associative array in one statement as it would have to contain duplicate keys- in this case every key would have to be 'categories'...

    Read the article

  • nHibernate, Automapping and Chained Abstract Classes

    - by Mr Snuffle
    I'm having some trouble using nHibernate, automapping and a class structure using multiple chains of abstract classes It's something akin to this public abstract class AbstractClassA {} public abstract class AbstractClassB : AbstractClassA {} public class ClassA : AbstractClassB {} When I attempt to build these mappings, I receive the following error "FluentNHibernate.Cfg.FluentConfigurationException was unhandled Message: An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail. Database was not configured through Database method." However, if I remove the abstract keyword from AbstractClassB, everything works fine. The problem only occurs when I have more than one abstract class in the class hierarchy. I've manually configured the automapping to include both AbstractClassA and AbstractClassB using the following binding class public class BindItemBases : IManualBinding { public void Bind(FluentNHibernate.Automapping.AutoPersistenceModel model) { model.IncludeBase<AbstractClassA>(); model.IncludeBase<AbstractClassB>(); } } I've had to do a bit of hackery to get around this, but there must be a better way to get this working. Surely nHibernate supports something like this, I just haven't figured out how to configure it right. Cheers, James

    Read the article

  • Chained address rewrite

    - by kemp
    What I need to do is rewriting this address: (1) http://localhost/wordpress/fake/text-value to (2) http://localhost/wordpress/gallery?somevar=text-value Notes: the remapping must be transparent: the user always has to see address (1) gallery is a permalink to a wordpress page, not a real address I basically need to rewrite the address first (to modify it) and then feed it back to mod rewrite again (to let wordpress parse it its own way). Problems if I simply do RewriteRule ^fake$ http://localhost/wordpress/gallery [L] it works but the address in the browser changes, which is no good, if I do RewriteRule ^fake$ /wordpress/gallery [L] I get a 404. I tried different flags instead of [L] but to no avail. How can I get this to work?

    Read the article

1 2 3 4 5 6  | Next Page >