Results 1 to 3 of 3

Thread: Dynamic textarea from drop down menu

  1. #1
    Join Date
    Aug 2006
    Posts
    65
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default Dynamic textarea from drop down menu

    I am creating a form that needs to be dynamic. I need to be able to select a Delivery Order number from the list and input Highlights into the text box. I need to be able to select more then one Delivery Order.

    So basically I need to select a Delivery Order from the list then write some data... then pick a new Delivery Order and write some data... I need it to be able to save the data until you click submit... Is there a way to do this? I have been looking online for a few days now but cant find anything (I may not be looking for the correct things).


    Code:
    <form name="WDR" action="WDR_add.php" method="post">
    <table>
    <tr>
              	<td colspan="6">
                	<strong>Select Delivery Order:</strong><br />
                      	<select name="DO">
                    	<option value="#" selected="selected">Select Delivery Order</option>
                     	<?php
    				  	 $query = "SELECT DONum, TaskName FROM DeliveryOrders ORDER BY TaskName";
     				  	 $result = mysql_query($query);
    				
    				  	 while($row= mysql_fetch_array($result))
    				  	 {
    				   	 $DONum = $row["DONum"];
    				  	 $TaskName = $row["TaskName"];	
    				  	 $DO = $DONum . "   " . $TaskName;
    				  	 print "<option value=\"$DONum\" > $DO </option>";
    			   	 	 } 	
    				 	?>
                        </select>
                </td>
              </tr>
              <tr>
              	<td colspan="6">
                	<strong>Reporting Period Highlights:</strong><br />
                    <textarea name="Highlights" cols="50" rows="9" id="Highlights"></textarea>
                </td>
              </tr>
              <tr>
                      <td><input name="Submit" type="submit" value="Submit WDR" /> </td>
                      <td colspan="2">&nbsp;</td>
                    </tr>
            
            </table>
    </form>

  2. #2
    Join Date
    Sep 2008
    Posts
    56
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Default Re: - Dynamic textarea from drop down menu

    Hi,

    Change the line: - <select name="DO">
    To: - <select name="DO" multiple>

    Now you will be able to select multiple value from the drop down by holding the ctrl button.

    Now when you will submit the button you will get DO as an array with all the selected values.

    Hope this solves the purpose.

    Cheers,

    ~Maneet
    LeXolution IT Services
    Web Development Services

  3. #3
    Join Date
    Aug 2006
    Posts
    65
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    I am able to select multiple ones from the drop down but what I really need is to be able to select ONE Delivery Order at a time and have a new textarea be created for each one that I select.....

    so say there is one textarea... I need for that textarea to clear everytime they pick a new Delivery Order.... but it also needs to save the text that was typed in the textarea for that Delivery Orders..

    Sorry its hard to explain

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •