I am really hoping someone can help me out with this. I am new to ASP. I have searched everywhere and I am sure this is probably a simple issue to resolve but I can't seem to find the answer.
I have 2 frames. The left frame has a listbox which I want the users to make a selection from.
Based on this selection, I would like for the information shown in the right frame to be updated, It should return a single recordset for each selection in the listbox.
Here is the code from the left frame...
This is the code to gather the details based on the QueryString from Nav.asp
The variable MovieTitle is defined in my include Setup.asp file.
I can populate the list box and I use the MovieNameVal textbox for validation as I work through this process.
My OnChange event populates the MovieNameVal textbox, and submits the form. However, the right frame never gets the QueryString that I am trying to pass to it. I have tried every permutation of the form ACTION but can't seem to figure this out.
These are 2 separate pages named Nav.asp which resides in the NavFrame, and MovieCard.asp which is the intended target for the QueryString which resides in the MainBodyFrame.
Any help would be greatly appreciated.
Thanks,
I have 2 frames. The left frame has a listbox which I want the users to make a selection from.
Based on this selection, I would like for the information shown in the right frame to be updated, It should return a single recordset for each selection in the listbox.
Here is the code from the left frame...
Code:
<!--#INCLUDE FILE="Include/Setup.asp" -->
<%Dim MovieList, NewMovieTitle
SQL = "Select Title From Movies"
SQL= SQL & " Order By Title"
Set MovieList = Server.CreateObject("ADODB.Recordset")
MovieList.CursorType = 1
MovieList.Open SQL, Conn
%>
<html>
<head>
<SCRIPT LANGAUAGE='javascript'>
function setNameFromSelect(sel) {
document.getElementById('MovieNameVal').value=sel.options[sel.selectedIndex].value;
document.frmGetMovieTitle.submit();
}
</SCRIPT>
</head>
<body bgcolor="#4287C9" >
<font size="2" color="#000000" face="Tahoma">
<br /><br />
<table border="0" width="100%">
<tr>
<td>
<FORM NAME="frmGetMovieTitle" ACTION="MovieCard.asp?MovieTitle="&MovieNameVal TARGET="MainBodyFrame" METHOD="post">
<select name="movie_title" align="left" size="25" OnChange="setNameFromSelect(this)" selected value=<%=MovieList("Title")%>>
<%
If MovieList.RecordCount <> 0 Then
Do While Not MovieList.EOF%>
<option value='<%=MovieList("Title")%>'><%=Left(MovieList("Title"),39)%></option>
<%
RecCount = RecCount + 1
MovieList.MoveNext
Loop
Else
RecCount = 0
%>
<option value="">No movies currently available</option>
<%
End If ' end If MovieList.RecordCount <> 0
%>
</select>
<%
MovieList.Close
Set MovieList = Nothing
Conn.Close
Set Conn = Nothing
%>
</td><!-- Col 1 -->
</tr>
<tr></div>
<br />
</font>
<td><br /><div align="center"><b><font size="2" color="#000000" face="Tahoma"><%=RecCount%> movies currently listed !</font></b><br /><br /></div></td><!-- Col 1 -->
</tr>
</table>
<input type="text" name="MovieNameVal" value="" size="50">
</FORM>
</body>
</html>
This is the code to gather the details based on the QueryString from Nav.asp
Code:
<!--#INCLUDE FILE="Include/Setup.asp" -->
<%Dim MovieCrd, MY_MOVIE_TITLE, MY_MOVIE_ORIGINALTITLE, MY_MOVIE_DIRECTOR, MY_MOVIE_GENRE, MY_MOVIE_YEAR, MY_MOVIE_RATED, MY_MOVIE_LANGUAGE, MY_MOVIE_MPAA, MY_MOVIE_LANGUAGEENCODED, MY_MOVIE_CODEC, MY_MOVIE_BITRATE, MY_MOVIE_RESOLUTION, MY_MOVIE_AUDIO, MY_MOVIE_ABITRATE, MY_MOVIE_CHANNELS, MY_MOVIE_NCD, MY_MOVIE_LENGTH, MY_MOVIE_RIPPER, MY_MOVIE_ACTORS, MY_MOVIE_NOTES, MY_MOVIE_PLOT
MovieTitle=Request.QueryString("MovieTitle")
If MovieTitle<>"" Then
SQL = "Select * From Movies"
SQL= SQL & " Where Title = '" & MovieTitle & "'"
SQL= SQL & " Order By Title"
Else
SQL="Select Top 1 * From Movies"
End IF
Set MovieCrd = Server.CreateObject("ADODB.Recordset")
MovieCrd.CursorType = 1
MovieCrd.Open SQL, Conn
%>
The variable MovieTitle is defined in my include Setup.asp file.
I can populate the list box and I use the MovieNameVal textbox for validation as I work through this process.
My OnChange event populates the MovieNameVal textbox, and submits the form. However, the right frame never gets the QueryString that I am trying to pass to it. I have tried every permutation of the form ACTION but can't seem to figure this out.
These are 2 separate pages named Nav.asp which resides in the NavFrame, and MovieCard.asp which is the intended target for the QueryString which resides in the MainBodyFrame.
Any help would be greatly appreciated.
Thanks,