Jump to content

Orionhunter

Members
  • Posts

    3
  • Joined

  • Last visited

Orionhunter's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Ok, I fixed it...I had to change my DOCTYPE! I was using Transitional, and I had to use Frameset ('cause I'm using IFRAMES).Now I can see the 2nd list data.
  2. I use Ajax + PHP to achieve that kind of stuff...(although I'm having some problems in submiting all the data)
  3. Hi!I'm new to AJAX and I'm trying to make something like this:- I have a multiple select list in my page with some options, and when I choose one of the options, I make a request via AJAX (to a PHP script) to retrieve me some data.- This retrieved data will be used to fill a second <SELECT> with some new options.Everything works fine and the the second list is created dinamically just like I wanted to.The problem is that when I press the submit button of the form, only the 1st list is sent through, and the new (2nd) list which was created on the fly, doesn't appear anywhere...not even in the source code.Just to get an idea, I'm placing the AJAX's response inside a DIV tag, via innerHTML....something like this:foo.html: <script LANGUAGE='JavaScript'> function treatAjaxResponse() { document.getElementById('ajax_result').innerHTML = ajax.responseText; }</SCRIPT>.....<FORM ACTION='script.php' METHOD='POST'><SELECT NAME='content1' ID='firstList' MULTIPLE> <OPTION>...</OPTION> ....</SELECT><DIV ID='ajax_result'> <! -- (Ajax's result code - the second SELECT list - goes here) --></DIV></FORM> script.php has something like this: <?php$output = "<SELECT NAME='content2' ID='secondList' MULTIPLE>";if(some_condition){ $output .= "<OPTION VALUE='test'> Test </OPTION>";}else{ ...}$output .= "</SELECT>";print $output;?> So...how can I make the contents of the secondList to go through the FORM, so that I can know what option did the user selected??Thanks in advance,Orionhunter
×
×
  • Create New...