|
From: nogueira_cristina on 6 May 2008 10:56 Hello, I hope someone can clarify the following for me. I have page which replaces the code of a certain <div> tag with other code (which on itself contains another div). The replacing of the code is done with AJAX. All divs have their id's set. The first replacement works fine. But I want the code in the second div (which is code that has been put in by the first replacement) to be replaced by the use of AJAX again. Somehow i can read the code which is in this second div. But replacing it doesn't work. Here is the example: This is the code that is put in a div with the first replacement. In this code there is a div called "divslct2" which contains a select box which needs to be replaced by other code depending on the first select box. The changeSlct() function uses AJAX to replace this code. If i put this code directly in the initial page that is loaded (so it won't be inserted by the first replacement) it works all fine. But when it's inserted by AJAX, i can't replace the code within the the div "divslct2". While i can read the code inside it just fine. What is going wrong? <form method="get" name="testform"> <table cellspacing="0" cellpadding="0" border="0"> <tr> <td>1a</td> <td> <select name="slct1" onChange="changeSlct('divslct2');"> <option value="s11">1</option> <option value="s12">2</option> </select> </td> <td>1b</td> <td> <div id="divslct2"> <select name="slct2" id="slct2"> <option value="s21">1</option> <option value="s22">2</option> </select> </div> </td> </tr> </table> </form>
From: Captain Paralytic on 6 May 2008 11:16 On 6 May, 15:56, nogueira_crist...(a)hotmail.com wrote: > Hello, > > I hope someone can clarify the following for me. > > I have page which replaces the code of a certain <div> tag with other > code (which on itself contains another div). > The replacing of the code is done with AJAX. > All divs have their id's set. > The first replacement works fine. > But I want the code in the second div (which is code that has been put > in by the first replacement) to be replaced by the use of AJAX again. > Somehow i can read the code which is in this second div. But replacing > it doesn't work. > > Here is the example: > This is the code that is put in a div with the first replacement. > In this code there is a div called "divslct2" which contains a select > box which needs to be replaced > by other code depending on the first select box. > The changeSlct() function uses AJAX to replace this code. > If i put this code directly in the initial page that is loaded (so it > won't be inserted by the first replacement) it works all fine. But > when it's inserted by AJAX, i can't replace the code within the the > div "divslct2". While i can read the code inside it just fine. > What is going wrong? > > <form method="get" name="testform"> > <table cellspacing="0" cellpadding="0" border="0"> > <tr> > <td>1a</td> > <td> > <select name="slct1" onChange="changeSlct('divslct2');"> > <option value="s11">1</option> > <option value="s12">2</option> > </select> > </td> > <td>1b</td> > <td> > <div id="divslct2"> > <select name="slct2" id="slct2"> > <option value="s21">1</option> > <option value="s22">2</option> > </select> > </div> > </td> > </tr> > </table> > </form> Since you have not posted any of the code that performs the task, there is nothing we can advise you on.
|
Pages: 1 Prev: Opera shows up bad code? Next: JavaScript A* Path Finding Prototype |