|
-
May 2nd, 2002, 04:18 PM
#1
Thread Starter
Hyperactive Member
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?
-
May 2nd, 2002, 06:30 PM
#2
Frenzied Member
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.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
May 3rd, 2002, 12:23 AM
#3
Junior Member
Have you tried simply not putting the submit.button ?
*SHOULD* work without it .)
-
May 3rd, 2002, 03:08 AM
#4
Fanatic Member
so long as you've got the form attributes set up correctly you shouldn't need a submit button
-
May 3rd, 2002, 03:08 AM
#5
Hyperactive Member
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.
-
May 3rd, 2002, 09:31 AM
#6
Thread Starter
Hyperactive Member
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?
-
May 3rd, 2002, 10:17 AM
#7
Frenzied Member
AFAIK: document.form1 is not part of any standard and shouldn't work in any complaint browser.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
May 3rd, 2002, 11:55 AM
#8
Fanatic Member
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.....
-
May 3rd, 2002, 11:58 AM
#9
Thread Starter
Hyperactive Member
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!
-
May 3rd, 2002, 01:03 PM
#10
Fanatic Member
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
-
May 3rd, 2002, 02:53 PM
#11
Frenzied Member
I just made a form without a submit button, and form1.submit() workied in both IE 5.5 and Netscape 4.
-
May 3rd, 2002, 03:20 PM
#12
Thread Starter
Hyperactive Member
oooh I'm using Netscape 6.2.2
______________________________________________________________________
5678
you are good but I am great...
-
May 6th, 2002, 07:15 PM
#13
Frenzied Member
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
-
May 7th, 2002, 05:40 AM
#14
Fanatic Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|