Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Junior Member
    Join Date
    Feb 2015
    Posts
    1
    Member #
    41501

    HTML Form Submit produces unwanted new screen for message box. Work around???

    I am working on a PHP/MySQL project. On the first page, the user enters a value in an HTML FORM FIELD to search for then clicks a SUBMIT BUTTON -- which sends POST data to a second php file that conducts the search. If there is a match the formatted record data is displayed -- if not, an error message in a box is displayed on a new screen. All works fine except that I want the error box to appear, superimposed, on top of the old screen where the user entered the search value.

    So I built a js alert routine which works great except the default HTML behavior is to produce a new screen when the user clicks the submit button - The js result is just like the original html message box - on a new screen.

    To recap, the logic of the HTML/PHP programming is:


    1. Take input - hit submit
    2. Go to next php program to check for a match
    3. If match, display formatted record
    4. if no match display error message in a box


    Is there a way to suppress the HTML new-screen behavior in the event of no-match? Or is there another work-around like saving the original screen and re-displaying it with the message box superimposed? Any other ideas?

    Thanks!
    Last edited by geno11x11; Feb 03rd, 2015 at 11:31 AM.

  2.  

  3. #2
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    You want AJAX for this.

    AJAX Tutorial
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)


Remove Ads

Posting Permissions

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

Tags for this Thread

All times are GMT -6. The time now is 06:26 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com