on-internet
← Community

echo php value into javascript onchange()

Stack Overflow ·

I have this html select form, I am using the onchange method to send and xmlhttp request. <select class="form-control form-control-sm" id="sizeselector<?php echo $row["id"]?>" name="sizes" onchange="showColors(<?php echo $row["id"];?>, item, size)"> <?php while($row1 = $result1->fetch_assoc()){?> <option value="<?php echo $row1["size"]?>"><?php echo $row1["size"]?></option> <?php}?></select> <div id="colorselector<?php echo $row["id"]?>"> <p>Text</p> </div> The above code works, but when I change it to get the actual values from the rows... onchange="showColors(<?php echo $row["id"];?>, <?php

Comments

Sign in or sign up to comment and upvote.

No comments yet.