yobo Posted September 8, 2012 Share Posted September 8, 2012 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 Quote Link to comment https://forums.phpfreaks.com/topic/268156-the-best-way-to-do-this/ Share on other sites More sharing options...
Jessica Posted September 8, 2012 Share Posted September 8, 2012 How would you do it with separate pages? Quote Link to comment https://forums.phpfreaks.com/topic/268156-the-best-way-to-do-this/#findComment-1376319 Share on other sites More sharing options...
Zane Posted September 8, 2012 Share Posted September 8, 2012 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. Quote Link to comment https://forums.phpfreaks.com/topic/268156-the-best-way-to-do-this/#findComment-1376320 Share on other sites More sharing options...
Jessica Posted September 8, 2012 Share Posted September 8, 2012 Wow, I read that like 4 times and didn't get that OP wanted AJAX. Moving to JS forum Quote Link to comment https://forums.phpfreaks.com/topic/268156-the-best-way-to-do-this/#findComment-1376322 Share on other sites More sharing options...
marginhound Posted September 12, 2012 Share Posted September 12, 2012 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) Quote Link to comment https://forums.phpfreaks.com/topic/268156-the-best-way-to-do-this/#findComment-1377151 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.