Jump to content

array prob


loveamit

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/287907-array-prob/#findComment-1476840
Share on other sites

"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.

Link to comment
https://forums.phpfreaks.com/topic/287907-array-prob/#findComment-1476845
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.