dcsimg
www.webdeveloper.com
Results 1 to 6 of 6

Thread: Submit form without changing the site

  1. #1
    Join Date
    Aug 2014
    Posts
    10

    Submit form without changing the site

    I am looking for a way to get a form to submit the entered values to the specified site without going to that site.

    Can anyone give ma a hint please?

  2. #2
    Join Date
    May 2004
    Location
    chennai, tamil nadu, India
    Posts
    451
    Ajax

  3. #3
    Join Date
    Mar 2011
    Location
    Rome, Italy
    Posts
    101
    If you're not familiar with Ajax/PHP, there's a workaround solution, almost easy if you're at least familiar with HTML/ASP (Javascript could be useful too)...

    You could send the query from your form to an iframe ASP page (using the post method), which could be included, just for example, inside a div container.
    The iframe page will take advantage from its url querystrings, managing the query request through some ASP code, in order to show the result.

    This way, your page url will remain the same and the query results will be managed by an "invisible" external page, inside the iframe.

  4. #4
    Join Date
    Aug 2014
    Posts
    10
    I am somewhat familar with php and javascript, however I do not quite understand the suggested solution using the iframe.
    The issue is, that the form is part of an jquery mobile app and I want to stay in that app.

  5. #5
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,500
    This page should give you enough information about how to make a Cross Domain Post

    http://stackoverflow.com/questions/2...via-javascript
    Yes, I know I'm about as subtle as being hit by a bus..(\\.\ Aug08)
    Yep... I say it like I see it, even if it is like a baseball bat in the nutz... (\\.\ Aug08)
    I want to leave this world the same way I came into it, Screaming, Incontinent & No memory!
    I laughed that hard I burst my colostomy bag... (\\.\ May03)
    Life for some is like a car accident... Mine is like a motorway pile up...

    Problems with Vista? :: Getting Cryptic wid it. :: The 'C' word! :: Whois?

  6. #6
    Join Date
    Mar 2011
    Location
    Rome, Italy
    Posts
    101
    Reading the first post, it wasn't clear you were referring to a mobile app. The need to submit a form without changing the main page url is a common request, so i thought you were talking about that.
    Just to clear my solution, for someone else who could wonder - by submitting a form through traditional asp code, the main page has to reload in order to elaborate the form request. So, having the form inside an iframe, it can perform the form action, while the main page url remains unaffected.

Thread Information

Users Browsing this Thread

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

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