SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict
    Join Date
    Jun 2004
    Location
    germany
    Posts
    263
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    submit button issue

    Hello,
    I have a submit button in a form.When user click this submit button i want to reload that page without submitting the page. ie after submitting i should not get the form elements on the target page.

    how to do this? need help

    with regards
    vimal
    Knowledge is all about Sharing

  2. #2
    SitePoint Enthusiast
    Join Date
    Apr 2003
    Location
    Maryland, USA
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can have a Reset button with the value "Submit" on it. Hope that is what you are looking for.

    Code:
    <INPUT TYPE="reset" VALUE="Submit">

  3. #3
    SitePoint Addict
    Join Date
    Jun 2004
    Location
    germany
    Posts
    263
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    reset wont do the job, for whatever form elements with which the form loads will be there when you press reset.
    I just want to know a way where you just press the submit button and instead of taking all the form values, the form just send to a url given in the action.

    I can use a image and do like this but what i want is using submit button
    Knowledge is all about Sharing

  4. #4
    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)
    Dont think that gonna happen there buddy ......... and I have to ask WHY???? I cant think of ANY reason to ever do this for one VERY important reason.... How the heck are your customers going to know if the form was sent or not..

    Thats one of my biggest pet peeves ..... you hit the submit button and you DONT get a "thanks" page or a "we got your info" page!

    To send data to a server you need whats called a request (your sending info to the server) and then a response (the server returns something back IE another page) ........... UNLESS (just thought of one use) You only want to print the data from the form onto that page.... but again Im not sure why. Things like this can be done with server-side code (IE: Java, PHP, ASP) but javascript is a client side language that doesnt really have the ability to communicate with a server.

    I think you need to explain what it is you're doing here so we can make more sense of it cause right now I think were ALL confused!

  5. #5
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    With any event you can call a function to do something, e.g.:

    window.location.href="another_page.htm";

    and then return false from the function to cancel the event:
    Code:
    function my_function()
    {	
    	.....
    	
    	return false;
    }
    <form onsubmit="return my_function()" method="get" action="default.htm">

  6. #6
    SitePoint Addict
    Join Date
    Jun 2004
    Location
    germany
    Posts
    263
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello 7 Stud,
    thanks mate and it worked.I have a page where i have to use like 3 forms and 2 forms have to be like where i need to take the submitted values and one more submit button where i should not take the values.Sounds complicated, but it is due to customer's new requirment over a very complicated and complex page and have to sort to this.

    Thanks for others also to help me in this
    with regards
    vimal
    Knowledge is all about Sharing


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
  •