Is it possible to submit the text box value (partnumber) as a query string in a hyperlink without submitting the form itself? I have been trying to achieve this by using document.getElementById("partnumber").value but keep getting an error "Object Required". Here is the code snippet:
<form id="form3" name="form3" method="post" action="formpost?rmaid=<%=rmaid%>">
<input name="partnumber" type="text" id="partnumber" size="10" />
<a href="suggest.asp?partnumber=<%document.getElementById("partnumber").value%>"><span class="style11">Suggest Link</span></a>
<input name="invoice" type="text" id="invoice" size="15" />
</form>
I am planning to open a new page in a pop-up window that lists values from the database. Once a value is selected, I would like it to come back into the invoice field on the original page. I think JavaScript may be able to help with this, but I am quite new to it. Can anyone provide assistance?
To pass values back to the parent window, you can use the following snippet in the child window:
<script language="javascript">
function changeParent() {
window.opener.document.getElementById('Invoice').value="Value changed..";
window.close();
}
</script>
<form>
<input type=button onclick="javascript:changeParent()" value="Change opener's textbox's value..">
</form>