0

I need to add the js code which is in script tag in select option on Form.How can i achieve this.

<select name="bcity" id="typeOfGlass" class="form-select-dashboard" placeholder="Pakistan">
 <!-- option values of city -->
<option  value="<?php echo $partner['bcity']; ?>"><?php echo $partner['bcity']; ?></option>
<option value="Rawalpindi">Rawalpindi</option>
 <option value="Multan">Multan</option>
<?php
 $cities=$helper->getcities();
 foreach ($cities as $city) { ?>
<option  value="<?php echo $city; ?>">
<?php echo $city; ?></option>

<?php    } ?>


<script type="text/javascript">
$('#typeOfGlass').on('change', function(){
console.log($('#typeOfGlass').val());

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.