-
invisible submit button?
for Netscape I need a submit button - but is there a way to make it invisible?
here is the code:
Code:
<!--autosubmit form For user changes return To adminusers.asp-->
<form name="form1" action="adminusers.asp" method="post">
<input type="hidden" name="companyid" value="<%=Request.Form("CompanyId")%>">
<input type="hidden" name="status" value="<%=Request.Form("status")%>">
<input type="hidden" name="userid" value="<%=Request.Form("userid")%>">
<input type="submit" name="submit" value="GO">
</form>
<script>document.form1.submit();</script>
The script at the end automatically submits the form, with the hidden fields. But right now, the user sees the GO button. How can I make the page blank? :confused:
-
I'm going out on a limb. :)
First, read over this: http://www.w3.org/TR/2001/WD-DOM-Lev...t-binding.html
Then play around with document.forms[0] or document.forms.item(0), instead of document.form1. Then you shouldn't need the submit button.
-
Have you tried simply not putting the submit.button ?
*SHOULD* work without it .)
-
so long as you've got the form attributes set up correctly you shouldn't need a submit button
-
Also, have a go with
<input type="hidden" value="submit">
If all else fails, place the Submit button with a <div> tag, then use style to move it offthe screen. That way, to the user, it is invisible.
-
Thanks for the tips...
DarthDust - it works without the submit button in IE but not in Netscape.
punkpie_uk - what errors are in my form code?
-
AFAIK: document.form1 is not part of any standard and shouldn't work in any complaint browser.
-
this works to hide stuff..
IE
document.formName.FormElemetn.style.visibility='hidden';
NS
document.layers.formName.visibility='hide';
i know CiberTHuG said that shouldn't work, but it does.
at least in IE 5 and up and NS4.7 not real sure about NS6 I belive that uses a different syntax...(getElementByID or something?)
but i think you can get away w/ not having the submit button at all. the script is what sends the form so you should't need the button.if it fails in NS try using visibility property as shown above.
it needs to be in a javascript tag i belive.....
-
pnj I am very new to this - do you have some sample code?
mine works in IE6 but not in Netscape, unless I have the submit button as part of the form
web programming is turning out to be a very interesting place to play - compatibility was never a problem for me with VB! :)
-
Code:
<input type="submit" name="submit" value="GO" style="visibility:hidden;">
this should work.
the <script> tag was throwing an error in IE......
i think there is probably an easier way to do what you trying to do. but if the way your doing it works, go with that.
i would be curious to know what your application does.
hope that helps
-
I just made a form without a submit button, and form1.submit() workied in both IE 5.5 and Netscape 4.
-
oooh I'm using Netscape 6.2.2
______________________________________________________________________
5678
you are good but I am great...
-
It must work. Otherwize there would be a lot of sites that would not work with 6. I know Netscape sucks, but I doubt that much :D
-
in IE 6/NS 6 use a inline layer (span) if you want the submit button to be hidden
Code:
<html>
<head>
<title>Untitled</title>
</head>
<body>
<form name="form1" method="get" action="page2.asp">
<input type="hidden" name="text1">
<input type="hidden" name="text2">
<span style="visibility:hidden; display:none;"><input type="submit" value="Go!"></span>
</form>
</body>
</html>
in NS4 you'll have to use <layer visbility="hide">...</layer> instead of the span.
But, if you want to submit the form use the W3C standard way
Code:
<script>document.forms('form1').submit()</script>
or
Code:
<script>document.forms(0).submit()</script>
I must admin that I do use document.form1 at times but its not part of the standard.