Link to home
Start Free TrialLog in
Avatar of marcus72
marcus72

asked on

Passing value through querystring.

Hi,
     I have a form where I want to pass text from a text box to input into a DB.  Here is my code, passing the ID value works but I am drawing a blank on how to pass the form textbox value.  Should I be putting the querystring in the form action property and using a regular submit button?  Thanks for help.

<form method="get" action="NpaUpdate.asp">

     <input type="hidden" name="ID" value="<%=npaRS("ID")%>">
     <input type="text" maxlength="20" size="15" name="wApproval">
     <a href=WowNpaUpdate.asp?ID=<%=npaRS("ID")%>&wApproval</a>Approve</a>

</form>
SOLUTION
Avatar of kollu
kollu

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Night0wl
Night0wl

sorry one additional statement. Use a regular submit button with what i wrote above
Avatar of marcus72

ASKER

Hi,
     Thanks both of you for your quick repsonses.  I tried the javascript function, however, when I try to the link it sending me to a "page cannot be found" page.  The URL is ending in PassValues().  A bigger picture of what I am trying to do is there are going to be multilple rows of records on the page with a textbox where a manager can enter their employee code to approve an employee transaction, so I thought it would be easiest to have a hyperlink at the end of each line that says update and transfer each line information via a querystring rather than posting it through a submit button.  Anyway the Javascript makes sense but isn't taking me to the right page.  Here is how I've written it:

<script language = "javascript">
function PassValues()
{
  var id = document.update.ID.value;
  var Approval = document.update.wApproval.value;
  window.location.href = "http://Server/folder/folder/NpaUpdate.asp?id="+ id + "&Approval=" + Approval;
}
</script>

<form name = frmname method="get" action="NpaUpdate.asp">

     <input type="hidden" name="ID" value="<%=npaRS("ID")%>">
     <input type="text" maxlength="20" size="15" name="wApproval">
     <a href="PassValues()"</a>Approve</a>
</form>


Ok what I've Done is Loop the form for each row.  And it seems to work, I guess I've use a combination of both suggestions is there a way to split the points?
just above the box you type in, there is a link that says "split".

from the help page:

More than one Expert helped solve my problem. What do I do?
https://www.experts-exchange.com/help.jsp#hi69
Done Thanks