|
 |
asp_databases thread: Form Functions Not Working
Message #1 by "Pat Wong" <vinyl-junkie@n...> on Mon, 3 Feb 2003 10:19:35 -0800
|
|
My question crosses the boundaries between HTML and ASP databases, but maybe someone can tell
me what I'm doing wrong. I have a search page I'm working on that seems to be functioning
pretty well except for a few things on a form I'm using. Neither the Clear function nor the
Start Over function is working as I want it to. I want Clear to reset the form values without
reloading the web page, and I want Start Over to reset the form values and reload the page.
Both functions still show the previously entered values on the form.
I'm not sure what the problem is. Maybe someone could take a look at the form portion my code
and help? (I'd post the entire piece of ASP code, but it's huge!) The fields used in the ASP
portion are gathered via a Request.QueryString statement. I hope I've provided enough
information. Thanks in advance for your help.
<form method="GET" action="MusicDBSearch.asp">
<input type="text" name="SearchArtist" size="22"
<% Response.Write "value='" & varSearchArtist & "' " %>
tabindex="1">
<input type="text" name="SearchAlbum" size="22"
<% Response.Write "value='" & varSearchAlbum & "' " %>
tabindex="2">
<input type="text" name="SearchSong" size="22"
<% Response.Write "value='" & varSearchSong & "' " %>
tabindex="3">
<input type="text" name="SearchComposer" size="22"
<% Response.Write "value='" & varSearchComposer & "' " %>
tabindex="4">
<select name="SearchFormat" >
<option selected value = ""></option>
<option value="Cassette">Cassette</option>
<option value="CD">CD</option>
<option value="CD-R">CD-R</option>
<option value="DVD">DVD</option>
<option value="LP">LP</option>
<option value="VHS">VHS</option>
<option value="45">45</option>
<option value="78">78</option>
</select>
<input type="reset" value="Clear" tabindex="5">
<input type="submit" value="Search" tabindex="6">
<input type="submit" action="MusicDBSearch.asp?" value="Start Over" tabindex="7">
</form>
~8^) Pat Wong (ICQ #61070813)
http://www.napathon.com/
-------------------------------------------------------------------
Senility Prayer:
God grant me the senility to forget the people I never
liked anyway, the good fortune to run into the ones I
like, and the eyesight to tell the difference.
-------------------------------------------------------------------
Message #2 by "Pat Wong" <vinyl-junkie@n...> on Wed, 5 Feb 2003 19:42:32 -0800
|
|
Gillian,
What I ended up doing was making the "value" variable name the same as the "name" variable on
each field. However, that wasn't exactly what I was trying to do, and I don't think I can't get
there from here. Here's an example of the way I did it for one of the fields from the screen:
<input type="text" name="SearchArtist" size="22" value="<%= SearchArtist %>" tabindex="1">
What I wanted to do was have the form fields display after the page refreshed, but then have
the Clear button empty them. Your code displays the form fields after the page refreshes, but
then the Clear button won't work. Making the "value" and "name" variables use the same thing
displays the page correctly, but form fields are blank when the page refreshes. I guess I can't
have my cake and eat it, too!
Thanks for your help though. I did learn a few things from it. :o)
----- Original Message -----
From: "Gillian Harber" <gillian@m...>
To: "Pat Wong" <vinyl-junkie@n...>
Sent: Tuesday, February 04, 2003 3:08 AM
Subject: Re: [asp_databases] Form Functions Not Working
| Pat,
|
| Here is what I would have done for your form code.
|
| <form method="GET" action="MusicDBSearch.asp">
|
| <input type="text" name="SearchArtist" size="22" value="<%= varSearchArtist
| %>" tabindex="1">
|
| <input type="text" name="SearchAlbum" size="22" value="<%= varSearchAlbum
| %>" tabindex="2">
|
| <input type="text" name="SearchSong" size="22" value="<%= varSearchSong %>"
| tabindex="3">
|
| <input type="text" name="SearchComposer" size="22" value="<%
| varSearchComposer %>" tabindex="4">
|
| <select name="SearchFormat">
| <option value = "" selected></option>
| <option value="Cassette">Cassette</option>
| <option value="CD">CD</option>
| <option value="CD-R">CD-R</option>
| <option value="DVD">DVD</option>
| <option value="LP">LP</option>
| <option value="VHS">VHS</option>
| <option value="45">45</option>
| <option value="78">78</option>
| </select>
|
| <input type="reset" value="Clear" tabindex="5">
|
| <input type="submit" value="Search" tabindex="6">
|
| <input type="button" onClick="document.location = 'MusicDBSearch.asp'"
| value="Start Over" tabindex="7">
|
| </form>
|
| Let me know if that helps
|
| Gillian
|
|
| ----- Original Message -----
| From: "Pat Wong" <vinyl-junkie@n...>
| To: "ASP Databases" <asp_databases@p...>
| Sent: Monday, February 03, 2003 6:19 PM
| Subject: [asp_databases] Form Functions Not Working
| >
| >
| > <form method="GET" action="MusicDBSearch.asp">
| > <input type="text" name="SearchArtist" size="22"
| > <% Response.Write "value='" & varSearchArtist & "' " %>
| > tabindex="1">
| >
| > <input type="text" name="SearchAlbum" size="22"
| > <% Response.Write "value='" & varSearchAlbum & "' " %>
| > tabindex="2">
| >
| > <input type="text" name="SearchSong" size="22"
| > <% Response.Write "value='" & varSearchSong & "' " %>
| > tabindex="3">
| >
| > <input type="text" name="SearchComposer" size="22"
| > <% Response.Write "value='" & varSearchComposer & "' " %>
| > tabindex="4">
| >
| > <select name="SearchFormat" >
| > <option selected value = ""></option>
| > <option value="Cassette">Cassette</option>
| > <option value="CD">CD</option>
| > <option value="CD-R">CD-R</option>
| > <option value="DVD">DVD</option>
| > <option value="LP">LP</option>
| > <option value="VHS">VHS</option>
| > <option value="45">45</option>
| > <option value="78">78</option>
| > </select>
| >
| > <input type="reset" value="Clear" tabindex="5">
| >
| > <input type="submit" value="Search" tabindex="6">
| >
| > <input type="submit" action="MusicDBSearch.asp?" value="Start Over"
| tabindex="7">
| >
| > </form>
| >
|
|
|
|
|
 |