javascript - Get link from checkbox -
if have checkbox , value want make link
<a href="uppdate02.cfm?id=(checkbox value)">uppdatera</a> this code using
<cfoutput query="rectest"> <table width="561" border="1"> <tr> <td width="43"><form id="form1" name="form1" method="get" action="uppdat02.cfm"> <input type="checkbox" name="id" id="yesno" value="#rectest.albid#"/> <input type="submit" value="submit" /> </form> </td> <td width="502">#rectest.album#</td> </tr> </table></cfoutput> i want value yesno should in link if have checkbox , value want make link
not sure use case, here's logic extract id dom node , emulate link behavior same.
<a id="uppdatera">uppdatera</a> <script type="text/javascript"> document.getelementbyid('uppdatera').addeventlistener('click', function(e) { window.location = 'uppdate02.cfm?id=' + document.getelementbyid('yesno').value; }, false); </script>
Comments
Post a Comment