Best Credit Cards | Buy Shares | Shares | Mortgage Insurance | Bad Credit Mortgages
weird form submit issue.. [Archive] - PCMech Forums

PDA

View Full Version : weird form submit issue..


PeteS99
01-21-2002, 12:58 PM
Hi there.

I'm working on a form for an internal application at my company. The basic code for the form is below. The problem goes like this...

When you load the page, type something in the text box, and hit Enter, the page simply refeshes without returning ANY results. If you type in the text box and CLICK the Submit button, the form works perfectly. Why do you suppose no results are returned upon the first method? Is there some piece code I need to insert into my Index.asp page to counter this? Thanks for any info!

~p

<pre>
&lt;form name="ChannelSearch" action="index.asp" method="post"&gt;

&lt;input type="text" name="SearchCriteria" size=20 maxlength=50&gt;
&lt;input type="submit" name="Action" value="Search"&gt;

&lt;br&gt;
&lt;font face="verdana,arial,helvetica" size="2"&gt;
&lt;input type="radio" name="SearchType" value="ChannelAlias" checked&gt; Channel Alias
&lt;br&gt;
&lt;input type="radio" name="SearchType" value="ChannelName"&gt; Channel Name
&lt;br&gt;
&lt;input type="radio" name="SearchType" value="ChannelID"&gt; Channel ID
&lt;br&gt;
&lt;input type="radio" name="SearchType" value="DomainName"&gt; Domain Name
&lt;/font&gt;

&lt;/form&gt;
</pre>

Goog
01-21-2002, 04:48 PM
No, it doesnt have anything to do with your index.asp page, you can do it with javascript.. here, this page outta do it:
http://javascript.about.com/library/scripts/blsubmitonenter.htm

enjoy.

PeteS99
01-21-2002, 05:06 PM
cool! i will try this out tomorrow. thanks Goog!!

Goog
01-21-2002, 07:26 PM
np, yer welcome.

PeteS99
01-22-2002, 09:35 AM
hmmm. still no dice.. works the same way. it appears that the form is being submitted, but the page simply refreshes and the query is not run. i am going to search for some more scripts...

mairving
01-22-2002, 10:10 AM
That's weird. Usually the only time I have seen it do that is if you put your reset button before your submit button. So that pressing Enter, clears instead of submitting.

PeteS99
01-22-2002, 10:36 AM
I think I have it licked!!
The ASP had this IF statement, for the Submit button:

if ucase(Request("Action")) = "SEARCH" ..

i need the functions that lie within that IF to run no matter what! so if someone hits Enter from the Text Box, the Submit button is being skipped over.. and when the data gets passed, this IF statement doesn't get turned on... leaving us with no search results!

i took out the IF portion, so this is mandatory.. and BAM, it works like a charm!

Goog
01-22-2002, 01:47 PM
cool..

hey mairving, nice signature :)

mairving
01-22-2002, 02:25 PM
Originally posted by Goog
cool..

hey mairving, nice signature :) Yeah, I meant to say something about yours early but forgot. It's open-source anyway, eh?

Goog
01-22-2002, 04:29 PM
Yeah, its from attrition.org (Thats where I got it anyway). I can tell u didnt copy mine because you added the single quotes around 'if your...' and thats the way it is on attrition, i removed them in mine for some reason..

heh.

there were a ton of funny quotes there, did u see the ones of actual instructions on foreign products?

mairving
01-22-2002, 09:13 PM
I really have no idea where it came from. I did a Goggle search on 'Linux Quotes' and it came up. I also like the Windows 95 or better quote which Statica has used before.

Goog
01-23-2002, 05:03 PM
Oh, you should check out http://www.attrition.org/quotes/
theres a lot of funny quotes there... techie type stuff to.. but the one in particular i found to be truly hilarious was this:
http://www.attrition.org/quotes/labels.html
its real instructions on labels of actual prodocuts.

Also, worth a look : http://www.attrition.org/quotes/bush.htm