I've been trying to create a form which is prefilled with info based on which link the user clicks. Since I'm not a hard core coder, I've asked around - and this was the solution I was suggested:
Querystrings with id tags and a Jscript function which looks like this:
<%@ Language="JScript" %>
<%
function RTS(inObject) {
inStr = String(inObject);
if (inStr=="undefined" || inStr=="null") {
inStr = "";
}
return inStr;
}
id = RTS(Request.QueryString("id"));
if(id=="1") {
activity = "Activity 1";
loc = "Location 1";
date= "Date 1";
time = "Time 1";
price = "Price 1";
}
if(id=="2") {
activity = "Activity 2";
loc = "Location 2";
date= "Date 2";
time = "Time 2";
price = "Price 2";
}
if (RTS(Request.Form("send"))!="1") {
%>
It works perfectly!
But when I tried to add my header.asp and footer.asp, which contains VBScript code and a link to a default javascript page, i get this error:
Active Server Pages error 'ASP 0140'
Page Command Out Of Order
/form.asp, line 8
The @ command must be the first command within the Active Server Page.
Line 8 reads: function RTS(inObject) {
So my question is: Is what I'm trying to do possible at all; I mean can I combine the two?? (The header with this piece of Jscript code). Or am I - not unlikely - missing something??
Or does anybody know another script that can do what this Jscript does and is more compatible with my header??
TIA
Regards,
OMG