Jump to content

The best way to do this


yobo

Recommended Posts

Hey All,

 

I am making a small application to help me learn, my question is this I am making a page where the users enters a number asset number that is they click submit and if that record exsists it will have a link underneath the input box saying record found click here to view details if the record does not exsist there will be a link saying record not found click here to add the record.

 

my problem is that I dont know how to do this on one page I can do it with seperate pages but not sure how to do it on one

 

any ideas please?

 

Joe

Link to comment
Share on other sites

Simply put, it is the use of javascript that allows a page to change instantly on a condition and/or user event.  It allows you to asynchronously send and receive data from other scripts.  jQuery is a framework for Javascript and is widely used.  I suggest you look into jQuery as it is the solution to your problem.

Link to comment
Share on other sites

Yup - you need two PHP pages.

 

"main" - shows the form - submit button uses jquery to extract value from form and send ajax request to 2nd page "service"

 

"service" - accepts an ajax request from "main" and returns appropriate data

 

when data is returned to main, perform any required reformatting and use jquery to append to the display area (usually a div)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.