Click to See Complete Forum and Search --> : object expected error


sniper
11-16-2005, 08:54 AM
I can't see my error. I've been trying to get this page to work for a couple of days but keep getting the object expected error for line 1, character 1. Maybe one of you will be able to see it.

<!-- #include file="BoutiqueIncludes\asp\Boutiques.asp" -->

<%
function RedirectURL(strURL)
request.Form.action = strURL
request.Form.submit()
end function

function ChangeLang(CurrentLang)
if CurrentLang = "EN" then
request.Form("hidLang") = "FR"
else
request.Form("hidLang") = "EN"
end if
RedirectURL("#")
end function

function popUpEbay(strEbaySite)
dim PathForEbay:PathForEbay = strEbaySite + "?hidLang=" + strLang + "&hidLoginGUID=" + strUniqueId + "&hidProgramSource=" + Application("strProgramSource") + "&hidEbayUserID=" + Application("strEbayUserID"+strLang)
response.Redirect(PathForEbay)
end function
%>

Thank you.

kier
11-16-2005, 09:01 AM
Try this:

<!-- #include file="../spares/BoutiqueIncludes/asp/Boutiques.asp" -->
<html>
<%
function RedirectURL(strURL)
request.Form.action = strURL
request.Form.submit()
end function

function ChangeLang(CurrentLang)
if CurrentLang = "EN" then
request.Form("hidLang") = "FR"
else
request.Form("hidLang") = "EN"
end if
RedirectURL("#")
end function

function popUpEbay(strEbaySite)
dim PathForEbay:PathForEbay = strEbaySite + "?hidLang=" + strLang + "&hidLoginGUID=" + strUniqueId + "&hidProgramSource=" + Application("strProgramSource") + "&hidEbayUserID=" + Application("strEbayUserID"+strLang)
response.Redirect(PathForEbay)
end function
%>
</html>

I think you just missed the HTML tags that make it into a page

sniper
11-16-2005, 09:10 AM
I have the html tags, although I did have the code inside the head tags. I tried moving it outside and I still get the error. Is it possible the error is on the included file even though it tells me it's on that page?

sniper
11-16-2005, 09:36 AM
Ok. I got rid of the error, but now all my links redirect to my homepage for some reason. Any ideas?

kier
11-16-2005, 09:44 AM
have you got a link to your site? Is it posted? Would be much easier if I could see what you are doing! It is possible that the error is on the file being included, have you made sure that it works alone?

buntine
11-16-2005, 08:37 PM
Not sure whats going on here.

There is no "action" property in the Form collection. Nor is there a submit() function.

Your VBScript looks a bit fused with client-side JavaScript.

Regards.