more information

P

POO

Thanks Rich Palarea and everyone else!
Unfortunately what I am developing is an intranet and can
not be accessed from the internet, so I can not show you
what I'm doing but here I'm giving you more details:
Lets say I have two pages: A.asp and B.asp
In the first one I capture some information and I have a
link to the second page passing that information (a
single data) in this way: B.asp?
Data=CapturedInformationOnPageA
So far it works, but the problem arises here:
I need to capture more data in B.asp regarding
CapturedInformationOnPageA and along with it post all the
information to a database. I have a form in B.asp with
form fields to capture the rest of the information, all
those fields are properly mapped to the database columns,
but as the CapturedInformationOnPageA is not a field in
the form, I can not mapped that data to the corresponding
database column.
I tried to add CapturedInformationOnPageA to the hidden
fields of the form in B.asp but I dont know what to put
in the VALUE field; I tried
writing "CapturedInformationOnPageA" (the name of the
received parameter in B.asp) but the result page has the
character string "CapturedInformationOnPageA" and not the
value it represents.
I have to solve this problem as long as
CapturedInformationOnPageA is the value for the master
key field in the table.
Any suggestions will be appreciated!!!
 
A

Alan McBee

First off, this would be immeasurably easier with ASP server-side script
than with client-side script, but this is possible. Why are you using .ASP
pages if you are not using ASP server-side script?

Keep your hidden form input field CapturedInformationOnPageA on the page
B.asp.

You will need to add a script to B.asp that is *something* like the one
below. I did not check this for accuracy. Also, you will need to pass one
and only one field from A.asp to B.asp. This will break if you pass more.

(NOTE: remove the . from the <.script> tag below)

<.script language="javascript">
function initField()
{
var sArgs = window.location.search;
var cchParamValue = sArgs.indexOf("=") + 1;
var sParamValue = sArgs.substr(cchParamValue);
document.getElementsByName("CapturedInformationOnPageA")[0].value =
sParamValue;
}
window.onload = initField;
</script>

HTH,
->Alan McBee
www.developervision.com
 
A

Alan McBee

First off, this would be immeasurably easier with ASP server-side script
than with client-side script, but this is possible. Why are you using .ASP
pages if you are not using ASP server-side script?

Keep your hidden form input field CapturedInformationOnPageA on the page
B.asp.

You will need to add a script to B.asp that is *something* like the one
below. I did not check this for accuracy. Also, you will need to pass one
and only one field from A.asp to B.asp. This will break if you pass more.

(NOTE: remove the . from the <.script> tag below)

<.script language="javascript">
function initField()
{
var sArgs = window.location.search;
var cchParamValue = sArgs.indexOf("=") + 1;
var sParamValue = sArgs.substr(cchParamValue);
document.getElementsByName("CapturedInformationOnPageA")[0].value =
sParamValue;
}
window.onload = initField;
</script>

HTH,
->Alan McBee
www.developervision.com
 
A

Alan McBee

First off, this would be immeasurably easier with ASP server-side script
than with client-side script, but this is possible. Why are you using .ASP
pages if you are not using ASP server-side script?

Keep your hidden form input field CapturedInformationOnPageA on the page
B.asp.

You will need to add a script to B.asp that is *something* like the one
below. I did not check this for accuracy. Also, you will need to pass one
and only one field from A.asp to B.asp. This will break if you pass more.

(NOTE: remove the . from the <.script> tag below)

<.script language="javascript">
function initField()
{
var sArgs = window.location.search;
var cchParamValue = sArgs.indexOf("=") + 1;
var sParamValue = sArgs.substr(cchParamValue);
document.getElementsByName("CapturedInformationOnPageA")[0].value =
sParamValue;
}
window.onload = initField;
</script>

HTH,
->Alan McBee
www.developervision.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top