asked on
<div class="container" id = "container">
<div class="form-group">
<label for="selfile" class="col-sm-2 control-label"> Select File </label>
<?php
$options = generate_files();
echo '<select id="selfile" name="selfile">'.$options.'</select>';
?>
</div>
<div class="form-group" id="fieldsdiv" >
<label for="selfile" class="col-sm-2 control-label"> Fields </label>
<button id="Fldsbutt" class = "multiSelect ui-widget sd ca" type="button" tabindex = "0" style="width:225px;">
<span class="ui-icon ui-icon-triangle-2-n-s"></span>
<span id="Pstext" class= "ui-text"> </span>
</button> <span id="pleaseWait"> </span>
<div id="selfields" class="multiSelectOptions">
</div>
<span id="Pss"> </span>
</div>
</div>
<script>
var base_url = '<?php echo site_url() ?>';
var controller = 'gen';
var method = 'mixed';
$(function() {
$('#selfile'). change(function() {
var $file = $('#selfile').val();
if($file !== undefined)
{
var $path = $file;
$.ajax({
url: base_url+'/'+ controller +'/' + method,
type: "POST",
data: {
file: $path,
},
success: function(ret_data) {
if (ret_data != 'error')
{
$('#pleaseWait').html('Click the arrow to select fields');
$('#selfields').html(ret_data);
$('#selfields').hide();
}
else $('#pleaseWait').html('');
}
});
} });
$('#selfields').mouseout(function() {
console.log('mouseout');
$('#selfields').hide();
});
$('#Fldsbutt'). click(function() {
$('#selfields').show();
});
});
</script>
</body>
</html>
JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and in almost every mainstream web browser.
TRUSTED BY