Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2007
    Posts
    26

    Unanswered: problems with check-boxes

    Hi,

    i face several problems with my check-boxes. so basicly i want to update doctor's schedule, so if user can choose which working days are updated using the check boxes, and input the replacement days in the provided drop down menu besides each check-boxes.
    so, actually the code look like this:

    Code:
    // the checkbox values are taken from dbase 
    <input type="checkbox" name="current[]" id="current[]" value="<?php echo $dayName." ".$timeFrom."-".$timeEnd; ?>"> <?php echo $dayName." ".$timeFrom."-".$timeEnd; ?> 
    
    <select name= "day<?php echo $a ?>" id= "day<?php echo $a ?>" class= "textBox">
    	<?php
    	   $resultDay = safe_query("SELECT d.dayName FROM day d");	
               while (list($dayNameDay)= mysql_fetch_array($resultDay))
    	   {						       
           ?>
    		  <option value= "<?php echo $dayNameDay?>"><?php echo $dayNameDay?></option>
    	<?php
    	   }
            ?> 
    </select>
    i can successfully takes the value of every checked check-boxes, but i can't got the value from any drop down box. it always point to the first value in drop down box (ex. sunday)

    so if i print_r the $_GET value it returns ouputs like
    Code:
    Array ( [day] => Sunday [current] => Array ( [0] => Tuesday 16:00:00-18:00:00 ) [1] => Wednesday 15:00:00-19:00:00)
    can anyone help me with this problem please?
    i really appreciate your help...


    so basicly $a is an incremental value that is used for naming the drop down boxes

  2. #2
    Join Date
    Feb 2007
    Posts
    26
    ups sory,
    the
    Code:
    Array ( [day] => Sunday
    should be written like this
    Code:
    Array ( [day0] => Sunday ......)
    sorry for that..
    can anyone help me with this problem? thank's

  3. #3
    Join Date
    Mar 2007
    Location
    636f6d7075746572
    Posts
    770
    In these dropdown boxes (with days sun->sat) are you choosing a different value before you submit your form? The default option is always the top one (i.e the one that gets written out first)

Posting Permissions

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