Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Trouble retrieving value with request.form

Reply
Thread Tools

Trouble retrieving value with request.form

 
 
Chris Shipley
Guest
Posts: n/a
 
      01-12-2004
I am trying to present a list of links on a page (Form) where each link
opens a different picture gallery. I have the Form page which contains the
links, a Gallery page, and several include files. Each include file displays
a different gallery.
Clicking on a link submits a value identifying the chosen gallery to the
Gallery page. The Gallery page accepts the value from the Form page and uses
it to call the appropriate include file.
The Post seems to have worked, the problem seems to be in retrieving the
value. The provided code for "gallery.asp" fails to execute properly- even
the line that displays "Test". I just can't seem to spot the error. Any
ideas?
TIA
Chris

FormPage:
<html>
<body>
<div id="Menu">
<script language=javascript>
document.write('<form name="frmGallery" method="post"
action="gallery.asp">');
document.write('<input type="hidden" name="GalName">');
tGall('Garden City', '2003REG-GrdnCity.inc');
tGall('River Hts', '2003REG-RvrHts.inc');
document.write('</form>');
</script>
</div>
</body>
</html>

function tGall(sGalName,sGalFile) {
var sJava = 'javascript:getGallery("' + sGalFile + '")';
document.write('<a href=' + sJava + '>' + sGalName + '</a><br>');
}

function getGallery ( SelectedGal ) {
document.frmGallery.GalName.value = SelectedGal ;
document.frmGallery.submit() ;
}

gallery.asp:
<script language=javascript>
document.write('Test');
var sName = request.form("GalName");
document.write(sName);
</script>

--
- -
Chris Shipley
==========================


 
Reply With Quote
 
 
 
 
Aaron Bertrand [MVP]
Guest
Posts: n/a
 
      01-12-2004
> document.write('<input type="hidden" name="GalName">');

You realize this doesn't have a value, right?

> gallery.asp:
> <script language=javascript>
> document.write('Test');
> var sName = request.form("GalName");
> document.write(sName);
> </script>


Client-side code doesn't know what Request.Form is. Aren't you getting an
error on this (object required or object expected)? Maybe you meant:

<script>
document.write('<%=Request.Form("GalName")%>');
</script>

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trouble retrieving window location from a previously opened window ? Mark Javascript 2 12-24-2005 06:34 PM
Trouble retrieving CSS properties via Javascript weston Javascript 11 11-08-2005 01:12 AM
Trouble With Retrieving A std::string From boost::program_options Starfox C++ 2 07-25-2005 01:31 PM
trouble retrieving data from ASPState Database =?Utf-8?B?R2xlbm4gVmVuemtl?= ASP .Net 2 07-30-2004 02:27 PM
Re: Retrieving value from a textbox in another web form Steve C. Orr, MCSD ASP .Net 0 07-22-2003 01:00 AM



Advertisments