Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery, chaining dynamically added selects
    primarykey
    data
    text
    <p>I'm having a problem with <a href="http://www.appelsiini.net/projects/chained" rel="nofollow">this</a> jQuery plugin that works with <code>select</code>s.</p> <p><a href="http://www.pastie.org/3056803" rel="nofollow">Here</a>'s my HTML and Javascript code. It's a bit large, primarily because of the many <code>option</code>s in the <code>select</code>.</p> <p>It works fine at first&mdash;it successfully copies the target elements. But after that, it stops working.</p> <p>I've been trying to fix it for two days and don't know what to do. I was <code>alert</code>ing all the variables in the plugin and found out that the backup variable doesn't have the right data and when it creates the element with <code>#location[2]</code> it also calls the plugin for <code>#location[1]</code>.</p> <p><strong>Better description of problem</strong> I had a three selects with f.e.: brand, model, color</p> <p>lets say the values could be:</p> <p><em>for brand:</em> Iphone, Nokia; <em>for model:</em> 4s, 5800; <em>for color:</em> black, white, blue, red</p> <p>and there' should be only these options:</p> <p>Iphone -> 4s -> black / white</p> <p>Nokia -> 5800 -> blue / red</p> <p>so when I select nokia -> 5800, I didnt want an option "white" or "black" to be shown.</p> <p>I used jQuery plugin (I linked it above) for this, and it works fine.</p> <p>The <strong>problem</strong> is: I have there a button to add another row of this selects and this plugin just stops working after inserting multiple rows. I know the problem is in plugin with variable <strong>backup</strong></p> <p>Can anyone tell what is causing the problem?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload