php - how can i send a value onclick on a image in javascript to get a value in to a text field -
i want value database coresponding image onclick. function not working can't define value in img tag how can send value function.
please help.
<script type="text/javascript"> function choose(x) { document.getelementbyid('color').value=x; } </script> <img src="admin/upload/<?php echo $data['image'];?>" value="<?php echo $data['color'];?>" width="25" height="25" onclick="choose(this.value);"/>
<script type="text/javascript"> function choose(x) { document.getelementbyid('color').value=x; } </script> <img src="admin/upload/<?php echo $data['image'];?>" title="<?php echo $data['color'];?>" width="25" height="25" onclick="choose(this.title);"/> just change attribute value title , onclick="choose(this.title)"
Comments
Post a Comment