www.webdeveloper.com
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2004
    Posts
    13

    submit a form without refresh

    Hello all,

    How is it possible to submit a form using javascript, without refreshing the window?
    How is it possible to make an http request "behind the scenes" without refreshing the browser? (using document.location.href=<URL> will refresh the window)

    thank you,

    Rami

  2. #2
    Join Date
    Jul 2006
    Posts
    84
    For second question, use ajax.

  3. #3
    Join Date
    Oct 2006
    Posts
    120

  4. #4
    Join Date
    Apr 2005
    Location
    Bathurst, NSW, Australia
    Posts
    3,357
    And to submit a form using javascript I think it is:
    document.getElementsByTagName('FORM')[0].submit()
    The answer to all these questions is Google.
    Give your thread a useful title | Webdeveloper.com Acceptable Use Policy
    Something wrong with your code? Validate first! |

    No Australian Net Censorship! The Australian government is wanting to follow in China's footsteps and "provide" nationwide Internet censorship, don't let them!

  5. #5
    Join Date
    Jul 2009
    Posts
    2

  6. #6
    Join Date
    Jul 2009
    Posts
    2
    In case the site goes down: here's an example:

    JavaScript Code:
    <script type="text/javascript">
    function changeText2(){
    var userInput = document.getElementById('userInput').value;
    document.getElementById('boldStuff2').innerHTML = userInput;
    }
    </script>
    <p>Welcome to the site <b id='boldStuff2'>dude</b> </p>
    <input type='text' id='userInput' value='Enter Text Here' />
    <input type='button' onclick='changeText2()' value='Change Text'/>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

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
HTML5 Development Center



Recent Articles