Category : codeigniter

I am dynamically generating a javascript file on my script in a controller method and adding this dynamically generated script in my html just like you would a regular javascript. In my php code I return return $this->response ->setBody($data) ->setHeader(‘text/javascript’) ->noCache() ->getBody(); $data is a variable that holds the data on the generated javascript file. ..

Read more

in my code i have a dynamic button of different colors i want to pick color_id from this button once they clicked or focussed. here is my code <p class="product-color"> Color : <?php foreach($avlcolers as $colors){ ?> <button type="button" title="<?php echo $colors[‘color_name’]; ?>" id="btn2" onclick="variationchange(<?php echo $colors[‘color_id’] ; ?>)" style="background:<?php echo $colors[‘color_value’]; ?>;padding:12px;border: 1px solid ..

Read more

i got this registeration for user,i use the js function at the submit button to prevent user from double click,but now the form will submit even though user did not inside name which is required,what should i do <?php echo form_open(‘user/register_cust_checkout’,array(‘class’=>’form-horizontal’,’id’=>”)) ?> <div class="row col-12 pr-0"> <div class="col-md-6 pr-0"> <div class="form-group"> <label class="control-label">Nama Penuh</label> <input ..

Read more

I am trying to send get request to CI controller with data of php date and insert it but keep getting this error: Uncaught SyntaxError: unexpected token: identifier this is the error in view-source date = 17 July 2021; This is my view and controller $(".btn-checkin").click(function() { id_user = <?php echo $this->session->userdata(‘id’) ?>; date = ..

Read more