html - how to get textbox value in hyperlink as id? -
hi want fetch value text box , append hyperlink id. here code unable value of textbox.
<li><a class="ajax-link" href="ajax/legal_notice.php?id=+ document.getelementbyid('cust_id').value">hypelink name</a></li> <div class="col-sm-6"> customer id </div> <div class="col-sm-6"> <input type="text" name="cust_id" id="cust_id" class="form-control" > </div>
kindly guide me how value text box.
try this
<html> <head> <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script> <script type="text/javascript"> alert("hello"); function resetlink(ele) { var href="ajax/legal_notice.php?id="+$(ele).val(); $(".ajax-link").attr("href",""+href); } </script> </head> <body> <li><a class="ajax-link" href="ajax/legal_notice.php?id=+ document.getelementbyid('cust_id').value">hypelink name</a></li> <div class="col-sm-6"> customer id </div> <div class="col-sm-6"> <input type="text" name="cust_id" id="cust_id" onchange="resetlink(this);" class="form-control" > </div> </body>
Comments
Post a Comment