CodeIgniter Forums

Full Version: works on fire fox , do not work on safari , chrome , ie
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]dinisptc[/eluser]
works on fire fox , do not work on safari , chrome , ie

i select on combobox a value but when i click on the calendar

the combobox gets unselected this only happens on safari , chrome , ie

on firefox works


Code:
[removed][removed]




        <?php
  echo form_label('Project', 'projectUID');
  echo br(1);
               $js = 'id="shirts"';


   echo form_dropdown('projectUID', $projects, set_value('projectUID', $projects),$js);
        
  ?>

  
<center>&lt;?php echo $calendar; ?&gt;</center>

[removed]

            $(document).ready(function() {

$('#shirts').change( function()
    {


                        
   $.ajax({
     url: [removed],
     type: 'POST',
     data: {
      day: -1,
      data: -1,
                                                proj: this.value,
                                                ajax: '1'
     },
                                      
     success: function(msg) {  
                                      
                                                //getElementById("shirts").value = this.value;
                                              
      location.reload();
                                                
     }      
    });

});



              
  $('.calendar .day').click(function() {


   day_num = $(this).find('.day_num').html();                                                            
   day_data = prompt('Enter Meeting', $(this).find('.content').html());
   if (day_data != null) {


                             var select_x=document.getElementById("shirts").value;
                    

                             if ((select_x != null)&&(select_x != '')) {


  
                          
    $.ajax({
     url: [removed],
     type: 'POST',
     data: {
      day: day_num,
      data: day_data,
                                                proj: select_x,
                                                ajax: '1'
     },
                                      
     success: function(msg) {  
                                      
                                                
                                              
     location.reload();
     }      
    });

                            


                                 }//shirts
                                 else{ alert("Must select a project");}
  
   }
  
  });

   return false;
  
});
  
[removed]

El Forum

[eluser]TheFuzzy0ne[/eluser]
It's really quite hard to read that code, but aren't you reloading the page when you get data back from your AJAX request? That will no doubt be the cause of your dropdown box being reset.

Also, you're using jQuery, but mixing it with normal Javascript. That shouldn't be a problem, but it makes your code inconsistent.