loveamit Posted April 21, 2014 Share Posted April 21, 2014 help me... suppose some data is fetched from database using while(mysql_fetch_array(**) and i want that on click of each fetched data from database one div must be opened up ..please somebody tell me help please Quote Link to comment Share on other sites More sharing options...
loveamit Posted April 21, 2014 Author Share Posted April 21, 2014 and i want to use javascript only to opend divs Quote Link to comment Share on other sites More sharing options...
ginerjm Posted April 21, 2014 Share Posted April 21, 2014 (edited) And just how is this an "array prob"? At least you have improved your writing since your last post with this subject name. Don't have a clue what you are doing though. One hint - usually people come to the forums with code (as you did before) and a problem rather than simply posing some situation you want to have written for you. As a general rule people who simply beg for help and say please please please do not get any better help than those who write intelligent posts that provide code, concise error/problem descriptions and requests for understanding. From what little I can imagine re: your brief post, you seem to want to produce an html div for each record you get from your php code's query and that you want that div produced by javascript. This would imply that you are doing an ajax request so that the results can be handled by the JS code that made the request. For a person who seems to be in the early stages of a web development career(?) you are attempting to do some very complex programming as a starting point. Perhaps you might consider just making this a php only task and simplify your project. Edited April 21, 2014 by ginerjm Quote Link to comment Share on other sites More sharing options...
bsmither Posted April 21, 2014 Share Posted April 21, 2014 "I am interested to learn how to write the necessary HTML and javascript that, when I click on a <div> containing data from a record of a recordset, that <div> will be visible." Commonly referred to as a "tabbed" display, one would: * Loop through the recordset. * Each iteration will build a <div id="id#"> block with id# being a reference to the record, such as $record['id'] and, * Each iteration add a tab (using css) to build up a series of tabs. That will result in a row of tabs followed by a series of <div> blocks of code, each with a unique id. In javascript, you will initially set all divs to have a visibility attribute of hidden, then make visible the first div. The javascript will be triggered on a click event from a tab, which will make visible the resective div. Quote Link to comment 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.