Results 1 to 14 of 14

Thread: invisible submit button?

  1. #1

    Thread Starter
    Hyperactive Member billwagnon's Avatar
    Join Date
    Jul 1999
    Location
    St. Louis, Missouri, Mississippi Valley
    Posts
    290

    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?

  2. #2
    Frenzied Member
    Join Date
    Feb 2001
    Posts
    1,140
    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.

  3. #3
    Junior Member
    Join Date
    May 2002
    Posts
    29
    Have you tried simply not putting the submit.button ?

    *SHOULD* work without it .)

  4. #4
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    so long as you've got the form attributes set up correctly you shouldn't need a submit button
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

  5. #5
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    uk
    Posts
    327
    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.

  6. #6

    Thread Starter
    Hyperactive Member billwagnon's Avatar
    Join Date
    Jul 1999
    Location
    St. Louis, Missouri, Mississippi Valley
    Posts
    290
    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?

  7. #7
    Frenzied Member
    Join Date
    Feb 2001
    Posts
    1,140
    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.

  8. #8
    Fanatic Member
    Join Date
    Jun 2000
    Posts
    537
    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

  9. #9

    Thread Starter
    Hyperactive Member billwagnon's Avatar
    Join Date
    Jul 1999
    Location
    St. Louis, Missouri, Mississippi Valley
    Posts
    290
    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!

  10. #10
    Fanatic Member
    Join Date
    Jun 2000
    Posts
    537
    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
    pnj

  11. #11
    Frenzied Member blindlizard's Avatar
    Join Date
    Feb 2001
    Location
    Austin, TX - United States of America
    Posts
    1,141
    I just made a form without a submit button, and form1.submit() workied in both IE 5.5 and Netscape 4.
    I drink to make other people more interesting!
    [vbcode]On Error GoTo Bar[/vbcode]
    http://www.monsterlizard.com

  12. #12

    Thread Starter
    Hyperactive Member billwagnon's Avatar
    Join Date
    Jul 1999
    Location
    St. Louis, Missouri, Mississippi Valley
    Posts
    290
    oooh I'm using Netscape 6.2.2


    ______________________________________________________________________


    5678

    you are good but I am great...

  13. #13
    Frenzied Member blindlizard's Avatar
    Join Date
    Feb 2001
    Location
    Austin, TX - United States of America
    Posts
    1,141
    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
    I drink to make other people more interesting!
    [vbcode]On Error GoTo Bar[/vbcode]
    http://www.monsterlizard.com

  14. #14
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    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.
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width