I am new to Jquery and taconite
I want to have a page that does the following
It has multiple panels
the first contains search criteria to submit a request to a mysql database
The second panel contains the results of the search
I would like to use radio buttons on the second panel to get more specific details from the data base and display them in a third panel.
I have got the second panel being populated as I want (using taconite etc)
The "front-end" php file creates the page with the required panels and the second panel is populated using teconite contentsReplace
I have a radio button function in the "front end" program but it doesn't work. I want it to query mysql and populate the third panel
Finally the second panel contains three tabs which are populated by the search.
All working as expected except the radio buttons.
any suggestions ???
PS Originally I used php/mysql to display all of the information from the records but the final page was unattractively large.
you don't need ajax-requests for do such things. the answer of haroldo is correct. taconite is useful for full-dynamic webpages.
if you create a search engine and you want get the results live without page-refresh, you can use taconite. if you want to change many parts of the page by one ajax-request, you can also use taconite. but when there are fix elements with static function: why a request? any request is traffic.
I'm not familiar with tactonite, but as far as the jquery goes there should be a an easy solution where the tabs id is the same as the radio's values:
$('.radios_class').click( function(){show_tab();})
function show_tab(){
var desired_tab = '#'+$(this).attr('value');
$('.tab_class').hide();
$(desired_tab).show();
}
Related
I've managed to construct a webpage template that has all the elements for a home page but I want to use the data in my database to then submit to produce results coming out once submitted.
When I choose the menu (which has successfully come through from the database) when I click submit and have a second php page to make this submit work, I do not get any results from the database or at best showing what I have selected.
What code do I need to produce results on submit page that would hold all the data selected?
I really am a beginner at this and using PHP, HTML, and Dreamweaver as my builder.
At first you have to understand HTML form methods and how to access form data using PHP.
For getting the values of the select box you can go to this link.
Get select box value using $_POST
In one of my projects, I have many different sections where I need to filter some data and select the required, for example - On newsletter page where I need to click a link to "add users" which opens up a popup window where I can search users by name, ID etc then check the checkboxes and click "Select". This adds their IDs (or maybe emails) in the hidden form on the Newsletter page.
Similarly, I need to attach a file to newsletter then I click on an another link which opens up a popup with list of files which I can search and then finally select one. I have similar other requirements in other sections of the website which means I have to write similar type of code again and again.
I won't mind duplicating code if it were to be used at one or two places. But I have more than 8-9 different sections where I have to select users, files, some other items etc so I was thinking if there was a generic plugin sort of tool which takes a url of the search page and returns the data back in a specific format to the parent opener window then I just include that code on each of these pages and just have to maintain one/two files only.
How would you handle this sort of requirement? Is there any JQuery plugin available which does similar thing?
I'm not aware of a plugin for this, but this Q&A looks relevant:
Open popup and refresh parent page on close popup
Perhaps you can be the hero who implements such a plugin, Mr user1421214!
I am tying to put some user data from the database using php.
The database contains so many record and i am displaying it using mysql_fetch_row() and this gives me the fields of first row.
Now the problem is a have two buttons namely next and previous. And when a click next the fields in the next row has to be obtained the they should be inserted into page without loading the page once again. I am facing problem with this.
I am using php for server side programming and html, css for client side programming.
I think that no one will give you the answer. Too many to write. You need to read about ajax (this is the technology that will allow you to do some action without page reloading).
You need to write javascript(you can use some library like jquery) function which will open some php page with the data that you want and then update your site.
Here you have some nice tutorial:
http://www.w3schools.com/jquery/jquery_ajax_intro.asp
I'm using smarty and I have two tabs where each tab contains a table. When the page loads at first, the two tables load data. Then every time the page is requested because of a button click (I use Ajax buttons), the two tables load data again.
What I want to do:
If I'm currently on the first tab, I just want to reload the first table.
and If I'm currently on the second tab, I just want to reload the second one. How can I achieve that?
I tried to use the $_SESSION variable, but it didn't help.
Also I tried to use a boolean variables that is true when I press the button and when I'm on the desired selected tab (I use a hidden input = selected tab in each tab). It didn't work either.
Can you suggest a way? It's a if condition, I guess...
I'm building a CMS that have 2 database tables, subjects & pages ... I have two drop down lists..And i want to let the user to insert values in it ...
The first drop down list is to select which table to insert in. The second drop down list is to select the position of the inserted item in that selected table.
So I want the user to select the table first, then -using PHP- change the second drop down list to contain the available position in that table. Note that all the previous stuff is in the same web page without pressing any button or something.
So all I want, a method to make PHP check the selected option in the first drop down list, and change the options in the second according to the first drop down list, all that in the same page without pressing any button..
Is that possible in PHP ?
You can use PHP in the background, but as selecting an option happens on the client side you'll have to use a combination of JavaScript/Ajax.
Have a look at YUI Autocomplete or other Ajax autocomplete frameworks.
The short answer to your question is no. PHP is server side, i.e. it can't be changed by user interactions without refreshing the page as it has finished executing before the HTML reaches the browser.
To do this you will need to use javascript and ajax.