Page 1 of 1

How to call the div,, Please help me out

Posted: Sat Oct 31, 2009 8:17 am
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.....

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

Posted: Mon Nov 02, 2009 11:04 am
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.

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

Posted: Mon Nov 02, 2009 8:59 pm
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.

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

Posted: Mon Nov 02, 2009 9:13 pm
by s1auk14
You can try this link to do the javascript and css http://taufin-in-work.blogspot.com/2009 ... ed-my.html

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

Posted: Mon Nov 02, 2009 9:48 pm
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

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

Posted: Tue Nov 03, 2009 1:15 am
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

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

Posted: Wed Nov 04, 2009 1:22 am
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

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

Posted: Wed Nov 04, 2009 1:23 am
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

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

Posted: Wed Nov 04, 2009 3:10 am
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:

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

Posted: Fri Jan 22, 2010 1:38 am
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 ...........