Please try the following code
<div class="button style="display:inline-block">
<a onclick='window.location.href="http://www.themodshop.co/warranty/" + document.getElementById("txtSearch").value;'>Submit</a>
</div>
質問
Alright, so im making a "warranty checker" i have an application ive created in c# that uploads a webpage to my server when a package is marked as shipped, which includes a countdown timer letting the customer know when their consoles warranty has expired. It looks as if my code is proper, however it obviously is not as i cant for the life of me get it to work.
Here is the code im using:
<input name="txtSearch" maxlength="12" size="25" type="text" class="field" id="txtSearch" />
<div> </div>
<div class="button style="display:inline-block">
<a type="submit" href='http://www.example.com/warranty/' + document.getElementById('txtSearch').value; return false;">Submit</a>
</div>
Thanks for any help on the matter.
解決
Please try the following code
<div class="button style="display:inline-block">
<a onclick='window.location.href="http://www.themodshop.co/warranty/" + document.getElementById("txtSearch").value;'>Submit</a>
</div>
他のヒント
<input name="txtSearch" maxlength="12" size="25" type="text" class="field" id="txtSearch" />
<div> </div>
<div class="button style="display:inline-block">
<a type="submit" href="javascript:void(0);" onclick="pgredirect();">Submit</a>
</div>
<script type="text/javascript">
function pgredirect(){
window.location.href = 'http://www.themodshop.co/warranty/' + document.getElementById('txtSearch').value;
}
</script>