How to call the div,, Please help me out

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Pirontech
Forum Commoner
Posts: 29
Joined: Wed Oct 28, 2009 5:31 am

How to call the div,, Please help me out

Post by Pirontech »

Dear All,

As my client want the functionality same as in the URL:
http://www.cleartrip.com/flights/result ... &x=17&y=10

when u open this link a data page opened which have a button "Details" after click on this button related data shown just below the prefetched data and so on....

i have no problem with showing the data from data base, but my problem is that i m not able to Generate the Show/Hide Div i tried lot but not success.

Can any one please give me any idea how to do this in PHP.

i m eagerly waiting for Yr. Replies? Plz Plz Help.....
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: How to call the div,, Please help me out

Post by pickle »

It doesn't matter how eager you are, you can still take 5 seconds to at least try to post in the correct category. :x

Moved.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: How to call the div,, Please help me out

Post by McInfo »

This is a JavaScript question.

Clicking a "details" link triggers a JavaScript routine that changes the CSS style or class of an HTML element containing the details and toggles the "display" style of that element from "none" to "block" or something appropriate.

Edit: This post was recovered from search engine cache.
Last edited by McInfo on Thu Jun 17, 2010 1:11 pm, edited 1 time in total.
s1auk14
Forum Newbie
Posts: 15
Joined: Mon Nov 02, 2009 8:29 am

Re: How to call the div,, Please help me out

Post by s1auk14 »

You can try this link to do the javascript and css http://taufin-in-work.blogspot.com/2009 ... ed-my.html
anasmuhammed
Forum Newbie
Posts: 2
Joined: Fri Oct 30, 2009 9:57 pm

Re: How to call the div,, Please help me out

Post by anasmuhammed »

Try This Javascript


Code: Select all

 
function hide(object)
{
object.style.visibility="hidden";
object.style.position="absolute";
}
 
or

Code: Select all

 
function show(object)
{
object.style.visibility="visible";
object.style.position="relative";
}
 
function show should be triggered onclick event of show button
function hide should be triggered onclick event of hide button
object to be displayed or hidden should be passed as argument or try getting object in javascript using following code in javascript itself

Code: Select all

var obj=document.getElementById('id of object to be hidden');


-Regards
-ima
rajeevbharti
Forum Newbie
Posts: 12
Joined: Fri Oct 30, 2009 12:43 am
Location: Delhi

Re: How to call the div,, Please help me out

Post by rajeevbharti »

anasmuhammed wrote:Try This Javascript


Code: Select all

 
function hide(object)
{
object.style.visibility="hidden";
object.style.position="absolute";
}
 
or

Code: Select all

 
function show(object)
{
object.style.visibility="visible";
object.style.position="relative";
}
 
function show should be triggered onclick event of show button
function hide should be triggered onclick event of hide button
object to be displayed or hidden should be passed as argument or try getting object in javascript using following code in javascript itself

Code: Select all

var obj=document.getElementById('id of object to be hidden');

thanks we need also this code. Thanks for posting the code ........



-Regards
-ima
Pirontech
Forum Commoner
Posts: 29
Joined: Wed Oct 28, 2009 5:31 am

Re: How to call the div,, Please help me out

Post by Pirontech »

s1auk14 wrote:You can try this link to do the javascript and css http://taufin-in-work.blogspot.com/2009 ... ed-my.html
Hi,

Thnks for reply, but my form have dynamic data i mean data pulled from the data base and only one "Div" tag repeated for all the data so this is not effective, its effective only when we have static Div i mean Form which swos the data know How many Dives are.

Please Reply

For More Please see this code:

<?
$result=QUERY RESULT;
while($object=mysql_fetch_object($resulty) ) {?>

<div>
<div>
<? $object ->question?>
</div>
<div>+Details</div>
</div>
<? }?>

on click this "+Details" another div open just below the clicked parent Div and show the additional information .......


Please Help Me Out
Pirontech
Forum Commoner
Posts: 29
Joined: Wed Oct 28, 2009 5:31 am

Re: How to call the div,, Please help me out

Post by Pirontech »

McInfo wrote:This is a JavaScript question.

Clicking a "details" link triggers a JavaScript routine that changes the CSS style or class of an HTML element containing the details and toggles the "display" style of that element from "none" to "block" or something appropriate.

Hi,

Thnks for reply, but my form have dynamic data i mean data pulled from the data base and only one "Div" tag repeated for all the data so this is not effective, its effective only when we have static Div i mean Form which swos the data know How many Dives are.

Please Reply

For More Please see this code:

<?
$result=QUERY RESULT;
while($object=mysql_fetch_object($resulty) ) {?>

<div>
<div>
<? $object ->question?>
</div>
<div>+Details</div>
</div>
<? }?>

on click this "+Details" another div open just below the clicked parent Div and show the additional information .......


Please Help Me Out
socalocmatt
Forum Newbie
Posts: 15
Joined: Tue Nov 03, 2009 12:45 pm

Re: How to call the div,, Please help me out

Post by socalocmatt »

Use the functions already posted and create the id dynamically and reference it in your link to show/hide

Code: Select all

 
<?
$result=QUERY RESULT;
while($object=mysql_fetch_object($resulty) ) {
$i++
?>
 
<div>
<div>
<? $object ->question?>
</div>
<div id='<? echo $i; ?>'>+Details</div>
</div>
<? } ?>
 
Then have the dynamically created link be some like:

Code: Select all

<a href="javascript&#058;show(<? echo $i; ?>); return false;">Show</a>
edit:
ok so for some reason the forum wont let me put javascript next to a : so in the code above replace javascript & #058 with javascript:
rajeevbharti
Forum Newbie
Posts: 12
Joined: Fri Oct 30, 2009 12:43 am
Location: Delhi

Re: How to call the div,, Please help me out

Post by rajeevbharti »

s1auk14 wrote:You can try this link to do the javascript and css http://taufin-in-work.blogspot.com/2009 ... ed-my.html

thanks for providing this link. it is helpful for me ...........
Post Reply