SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Jul 2004
    Location
    Tacoma, WA
    Posts
    178
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Submitting a Form without Using Submit Button

    Is it possible to submit a form without hitting the submit button. How would you do that? Because I can't think of a way of doing that.

    Also is there a way to submit a form without using the submit button and is there a way of asking:

    if( submit form button WAS NOT pressed)
    {
    //Loop through all the choice forms and return through URL
    {
    else
    {
    // validate the page
    }

    I was thinking that even if you used the .submit() object in JavaScript to submit the form then all the form variables would be submitted. Iím blocked here.

  2. #2
    SitePoint Wizard gold trophysilver trophybronze trophy dc dalton's Avatar
    Join Date
    Nov 2004
    Location
    Right behind you, watching, always watching.
    Posts
    5,431
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can submit a fornm from just about anywhere you want. You can "hotlink" dropdowns (selects) buttons etc...

    in other words you can set a dropdown to submit like this

    <form method='post' action='some_action'>
    <select name='something' onchange='this.form.submit();'>
    <option value='1'>1</option>
    <option value='2'>2</option>
    </form>

    OR you could do something similar on a radio button

    <form method='post' action='something'>
    <input type='checkbox' name='something' onclick='this.form.submit()'>
    </form>

    now as far as the 2nd part of your question I need a little clarification ---- You could also call a function in almost the same fashion - if what you want is there submit the form from you js - if not just return false


Bookmarks

Posting Permissions

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