Form with no submit button? Help

Discussion in 'HTML & Website Design' started by ianlufc, Apr 22, 2008.

  1. #1
    hi guys

    im sending infor from a form
    <form method="post" action="https://www.sendtohere.com">
    <INPUT name="d" type="hidden" value=" your name">
    <INPUT name="c" type="hidden" value="your add">
    <INPUT name="b" type="hidden" value="your ref">
    <?
    echo "<INPUT name='a' type='hidden' value='.$phNo.'>";
    echo "<INPUT name='aa' type='hidden' value='Hi '.$names.' .'>";
    ?>
    <input type="submit" value="Send">

    im using php aswell as html...what i want to do is to leave the button out, so that the form POSTS the information automatically without having to press the button as its going to work in the background.
    Can anyone tell me how to do this
    Thanks Guys
     
    ianlufc, Apr 22, 2008 IP
  2. Digitank

    Digitank Guest

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    you could put an onload call in the body tag of the html to submit the form. If you are using php I am sure there is a more elegant way of trying to accomplish what youare doing. This code might not have the right syntax but should give you some clues.

    <body onload="javascript:form.formname.submit();">
     
    Digitank, Apr 22, 2008 IP
  3. ianlufc

    ianlufc Peon

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    cheers mate

    i got it by doing this

    <script type="text/javascript" language="JavaScript"><!--

    document.sendReg.submit();

    //--></script>
     
    ianlufc, Apr 22, 2008 IP
  4. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #4
    This can't be done using HTML alone, and is recommended that it NOT be done at all. What is the point of having a form if it can't be submitted? Also don't forget that some people don't use browsers that have JavaScript enabled (or supported), and a lot of mobile devices that can access your site as well don't support JavaScript well (if at all).
     
    Dan Schulz, Apr 23, 2008 IP