Help with a "form" and displaying results. (Newbie here!)

04-20-05, 09:43 AM
|
|
Newbie Coder
|
|
Join Date: Apr 2005
Location: Austin TX USA!
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Help with a "form" and displaying results. (Newbie here!)
Hello all,
My name is Albert and I am interning at "South Texas Youth Soccer Association" (stxsoccer.org) a not-for-profit organization.
As I have been trained to be a web "Designer", I don't know much code or scripting.
-------------------------------------------------------------------------
Here is the problem...
If you'll notice on this page,
http://www.stxsoccer.org/tournaments/invitationals/
you have to select a month and a year to see the available tournaments.
Then the results will show just for that month.
How can I get that page to show the results for the whole year?
If you need more details or the source code, just let me know.
I got what you need right here.
I appreciate any help,
-Albert
|

04-20-05, 10:21 AM
|
|
|
can you post the sql statement
"select something from somwhere where..." it should look similar to that
just change it accordingly, i am thinking add a button on the search page, taht says year and use the drop that is alredy there..it would then need an if statement on the results page
i will be glad to help along the way..
|

04-20-05, 10:38 AM
|
|
Newbie Coder
|
|
Join Date: Apr 2005
Location: Austin TX USA!
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi Koncept,
I don't think there is SQL involved.
I'm pretty sure it's a "Windows based server".
And it's pulling the data from our "INTRANET" (stxsoccer.org/INTRANET)
I do know some Flash ActionScripting and so I know code structure a little.
I'll explain how I tried to solve this problem in my next post shortly.
I hope that will give you an example of how I think and perhaps that can help you help me.
If I sound like I don't know what I'm talking about, it's because I really don't.
Thanks for your speedy reply.
-Albert
|

04-20-05, 10:50 AM
|
|
Newbie Coder
|
|
Join Date: Apr 2005
Location: Austin TX USA!
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
This is what I tried to do and it did not work.
I included all the form code along with the ASP code that is integrated with it.
__________________________________________________
<form action="dateresults.asp" method="post" name="datesearch" id="datesearch">
<select name="sMonth" class="bodyTxt" id="sMonth">
<option selected>-- Select Month --</option>
<option value="1,2,3,4,5,6,7,8,9,10,11,12">All</option> <------(I added this line.)
<option value="1">January</option>
<option value="2">February</option>
<option value="3">March</option>
<option value="4">April</option>
<option value="5">May</option>
<option value="6">June</option>
<option value="7">July</option>
<option value="8">August</option>
<option value="9">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12">December</option>
</select>
<select name="sYear" class="bodyTxt" id="sYear">
<% While (NOT rsTDates.EOF) %>
<% TDATE = (rsTDates.Fields.Item("Start_Date").Value)
TYear = Year(TDATE) %>
<% If (TYear <> TempYear) Then %>
<option value="<%=TYear%>" <%If (Not isNull(Year(Date))) Then If (TYear) = CStr(Year(Date)) Then Response.Write("SELECTED") : Response.Write("")%> ><%=TYear%></option>
<% TempYear = TYear %>
<% End If %>
<% rsTDates.MoveNext()
Wend
If (rsTDates.CursorType > 0) Then
rsTDates.MoveFirst
Else
rsTDates.Requery
End If
%>
</select>
<input name="Submit" type="submit" class="bodyTxt" value="Go">
</form>
__________________________________________________ ____
-Albert
Last edited by Rusty Ranchero; 04-20-05 at 10:56 AM.
Reason: Spelling errors and extra clarification.
|

04-20-05, 12:06 PM
|
|
|
you will still need an all, but set its value to be all, do not read into the sql part, anything that references a database (access, mysql, mssql, oracle, ect) use sql statements to retrieve and modify data
can you post the code to the results page, i think we can solve this quickly
|

04-20-05, 12:35 PM
|
|
Newbie Coder
|
|
Join Date: Apr 2005
Location: Austin TX USA!
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Here you go, thanks for the help so far.
I appreciate your patience.
__________________________________________________ __________
<td align="left" valign="top" class="pgTitle">Search Results
- <%= MonthName(Request("sMonth"))%> <%= Request("sYear")%></td>
</tr>
<tr>
<td> </td>
</tr>
<%
While ((Repeat1__numRows <> 0) AND (NOT rsTDates.EOF))
%>
<% If (rsTDates.Fields("End_Date") >= Date) Then %>
<% If (CStr(Request("sMonth")) = CStr(Month(rsTDates.Fields("Start_Date")))) AND (CStr(Request("sYear")) = CStr(Year(rsTDates.Fields("Start_Date")))) Then %>
<%
' Build Date String
StartDate = fncFmtDate(rsTDates("Start_Date"), "%d")
EndDate = fncFmtDate(rsTDates("End_Date"), "%d")
TMonth = fncFmtDate(rsTDates("Start_Date"), "%B")
TYear = fncFmtDate(rsTDates("Start_Date"), "%Y")
If StartDate = EndDate Then
TDates = TMonth + " " + StartDate + ", " + TYear
Else
TDates = TMonth + " " + StartDate + "-" + EndDate + ", " + TYear
End If
%>
<tr>
<td align="left" valign="top" class="bodyTxt"><a href="tournamentdetail.asp?id=<%=(rsTDates.Fields. Item("ATournID").Value)%>"><strong><%=(rsTDates.Fi elds.Item("Tourn_Name").Value)%></strong></a><br> <span class="smBodyTxt"><%=TDates%> - <%=(rsTDates.Fields.Item("Location").Value)%></span></td>
</tr>
<% RS_Exist = 1 %>
<% End If %>
<% End If %>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsTDates.MoveNext()
Wend
%>
<% If RS_Exist = 0 Then %>
<tr>
<td align="left" valign="top" class="bodyTxt">There are
no tournaments for <%= MonthName(Request("sMonth"))%> <%= Request("sYear")%>. <br> </td>
</tr>
<% End If %>
<tr>
<td> </td>
</tr>
</table>
Last edited by Rusty Ranchero; 04-20-05 at 12:37 PM.
Reason: spelling
|

04-20-05, 12:50 PM
|
|
Newbie Coder
|
|
Join Date: Apr 2005
Location: Austin TX USA!
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hey!
So "sMonth" and "sYear" are some kind of class or property of ASP, right?
and by default, sMonth understnds the value 1 = January and value 3 = March ect., right?
So is there a value that = all the months? Like "13" or "all" or whatever?
_____________________________________________
My time here at he office is over for the day,
I'll see you tomorrow!
Thanks again.
-Albert
Last edited by Rusty Ranchero; 04-20-05 at 01:10 PM.
|

04-22-05, 09:33 AM
|
|
Newbie Coder
|
|
Join Date: Apr 2005
Location: Austin TX USA!
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Bump. 
|

04-22-05, 10:47 PM
|
|
|
i though i had posted a reply, i guess not....
no they are the requested from item (month & year) you would still need to have one for all but then use an if statement to say if this then this else that so it changes how it get looked at, can you post all the code for the results page, bc i think im missing something there. it should be using a sql statement and i dont see one
|

04-24-05, 05:55 PM
|
|
New Member
|
|
Join Date: Apr 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Rusty Ranchero...
OK mate, this could go on forever... what we are looking for is something that looks like this:
conn.execute("SELECT * FROM tournaments WHERE Month(Start_Date) = " & CStr(Request("sMonth")) & " AND Year(Start_Date) = " & CStr(Request("sYear")) )
My comments on the code so far:
I'm a neat freak and just looking at your code makes me shiver... trying to debug code that is not commented, not indented & the variable names are just plain weird is a nightmare. Perhaps if its possible... send me the code, all the code and nothing but the code once you've done a lil neatening up of it and I could probably find some time in my schedule to ahve a look at it.
Applause to koncept for even attempting the debug 
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|