"|-|erc" <us*************@wwwadamskingdom.com> writes:
these 3 lines will put the following into the URL bar!
but with 2 input boxes it doesn't.
Actually, it does it with two input boxes too in my browser.
<form name=test>
<INPUT name='selqty2'>
</form>
file:///C:/WINDOWS/DESKTOP/tttt2.html?selqty2=55555
Is there a way to stop the URL bar changing and the page refreshing
when people press Enter on a single text input?
Pressing enter in a text input box will submit the form it is in.
Your form doesn't have an action attribute, which is required in HTML.
That is, your HTML is invalid. Fix that before going any further.
If you don't want to submit the form, you shouldn't have a form
element at all. (Generally, if you have an element and want to leave
out a required attribute, you are probably using it incorrectly.)
There is ofcourse the problem that Netscape 4 only accepts form
controls inside a form element. That means that if your page must
work in Netscape 4 (which is a browser so far from modern standards
that it ought to be dead and buried long ago), you must have the
form element.
A form control without a form is legal HTML. There is no way to submit
it, so you are probably using Javascript to access the control. That
means that your page depends on Javascript.
What you can do to make both Netscape and the HTML specification
happy, is to add an action attribute that directs the user to a page
that tells him why your page requires Javascript, and then use
Javascript to prevent the form from being submitted.
<form id="test" action="noJS.html" onsubmit="return false">
<input name="selqty2">
</form>
/L
--
Lasse Reichstein Nielsen -
lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'