[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Passing value through querystring.

Posted on 2006-05-04
7
Medium Priority
?
2,348 Views
Last Modified: 2008-01-16
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>
0
Comment
Question by:marcus72
7 Comments
 
LVL 5

Assisted Solution

by:kollu
kollu earned 375 total points
ID: 16605879
Write a small Javascript function as following and pass both the variables

<script language = "javascript">
function PassValues()
{
  var id = document.frmname.ID.value;
  var Approval = document.frmname.wApproval.value;
  window.location.href = "pagename?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>

From next page use variables as request("id) and request("Approval") to get the values
0
 
LVL 2

Accepted Solution

by:
Night0wl earned 375 total points
ID: 16605907
Your code is fine so far

but on your page NpaUpdate.asp in the browser it will sayNpaUpdate.asp?wapproval=<the value of the field>

in asp all you need is

varWapproval = response.querystring("wapproval")

this will store the value of wapproval into a variable so you can input it into the database
0
 
LVL 2

Expert Comment

by:Night0wl
ID: 16605926
sorry one additional statement. Use a regular submit button with what i wrote above
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:marcus72
ID: 16606261
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>


0
 

Author Comment

by:marcus72
ID: 16607383
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?
0
 
LVL 22

Expert Comment

by:WMIF
ID: 16607535
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?
http://www.experts-exchange.com/help.jsp#hi69
0
 

Author Comment

by:marcus72
ID: 16607770
Done Thanks
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
Integration Management Part 2
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question