This content has been marked as final.
Show 25 replies
-
1. Re: Show Hide Inside a Repeat Region
Newsgroup_User Sep 13, 2007 9:39 AM (in response to oicram)You need to give the DIV a unique name by using the loop counter, then in
your function do the same so that the correct DIV corresponds to the coorect
row.
"oicram" <webforumsuser@macromedia.com> wrote in message
news:fcboc1$419$1@forums.macromedia.com...
> I'm trying to apply a show-hide to a DIV that is inside a repeat region.
>
> The problem is that only the first record of the repeat region seams to
> work
> properly, on all others theres no such think as hide show. Why?
>
> here is the link:
> http://www.cantinho.org/admin/cantinho/find_search_result.php
>
> Hope someone can help me out here.
>
>
> Thanks,
>
>
>
>
-
2. Re: Show Hide Inside a Repeat Region
oicram Sep 13, 2007 10:10 AM (in response to oicram)Honestly, I have no skills to translate what you have told me to code examples. :(
Can you give me an example of how that could be in my case. Please...
Thanks for your help. -
3. Re: Show Hide Inside a Repeat Region
Newsgroup_User Sep 13, 2007 12:02 PM (in response to oicram)"oicram" <webforumsuser@macromedia.com> wrote in message
news:fcbqu9$6mp$1@forums.macromedia.com...
> Honestly, I have no skills to translate what you have told me to code
> examples. :(
>
> Can you give me an example of how that could be in my case. Please...
>
>
> Thanks for your help.
Ah okay it was as I expected, to make those id's unique you can employ a
counter, this counter is incremented each time the recordset moves to the
next record, you add the counter to the id of the object referenced by
scripts.
<?php $counter = 0; ?>
<!-- BEGIN REPEAT REGION -->
<?php
$counter = $counter + 1;
?>
<a href="#" onCLick="thisIsJavaScriptThatSoesSomeThingWith('Layer<?php echo
$counter; ?>');">show/hide</a>
<div id="Layer<?php echo $counter; ?>">
</div>
<!-- END REPEAT REGION -->
this should arrive at the browser like
<a href="#"
onCLick="thisIsJavaScriptThatSoesSomeThingWith('Layer1');">show/hide</a>
<div id="Layer1">
</div>
<a href="#"
onCLick="thisIsJavaScriptThatSoesSomeThingWith('Layer2')">show/hide</a>
<div id="Layer2">
</div>
-
4. Re: Show Hide Inside a Repeat Region
oicram Sep 13, 2007 12:35 PM (in response to oicram)Thanks a lot. I will test it and if I have any question I will post back. Thanks for your help. -
5. Re: Show Hide Inside a Repeat Region
oicram Sep 13, 2007 2:14 PM (in response to oicram)Ok. I ask you to have patience... :s
So I have a PHP counter that will start with the repeat region, and every time the repeat region repeats a region the counter adds one.
Then, I have the layers that the counter will dynamicly change ther name by doing: Layer<?php echo
$counter; ?> and this will correspond for the Browser to layer1 if its the first repeat record, layer2 if it is the second record etc...
After this I don't understand. :(
I mean, how he will interact with the javascript code?
I know here:
a href="#" onCLick="thisIsJavaScriptThatSoesSomeThingWith('Layer<?php echo
$counter; ?>');">show/hide</a>
But my javascript code is static.
I explain:
I cannot use the show / hide available by dreamweaver because if the region is hide (he show white space with nothing inside) well I prefer to quit the "white space when we make a hide so I use the properties on: style.display.
The script that I get (don't remember where) to do this is:
<Script>
function showDiv() {
document.getElementById("div_name").style.display="none";
}
</Script>
But with a script like this, no matter what I put in the repeat region, he will always look for the name that I have in this script, right?
So... I have to put it dynamic, but for that I need to declare the counter before this script. After that can this be something like:
<Script>
function showDiv() {
document.getElementById("div_name<?php echo
$counter; ?>").style.display="block";
}
</Script>
and also to hide:
<Script>
function hideDiv() {
document.getElementById("div_name<?php echo
$counter; ?>").style.display="none";
}
</Script>
Result, of all this? No errors, but I have a very big white page with nothing in there!!!!!
http://www.cantinho.org/admin/cantinho/find_search_result_v2.php
Please.... have patience and help me out... I'm trying to learn, but this is my first steps in code.
Thanks a lot.
Add-on:
Preliminary question: is there a way to change the show/hide from dreamweaver to work like "style.display" with values "none" and "block"?
-
6. Re: Show Hide Inside a Repeat Region
Newsgroup_User Sep 13, 2007 2:37 PM (in response to oicram)
"oicram" <webforumsuser@macromedia.com> wrote in message
news:fcc98i$lqo$1@forums.macromedia.com...
> Ok. I ask you to have patience... :s
>
> So I have a PHP counter that will start with the repeat region, and every
> time
> the repeat region repeats a region the counter adds one.
>
> Then, I have the layers that the counter will dynamicly change ther name
> by
> doing: Layer<?php echo
> $counter; ?> and this will correspond for the Browser to layer1 if its the
> first repeat record, layer2 if it is the second record etc...
>
> After this I don't understand. :(
> I mean, how he will interact with the javascript code?
> I know here:
> a href="#" onCLick="thisIsJavaScriptThatSoesSomeThingWith('Layer<?php echo
> $counter; ?>');">show/hide</a>
>
> But my javascript code is static.
> I explain:
>
> I cannot use the show / hide available by dreamweaver because if the
> region is
> hide (he show white space with nothing inside) well I prefer to quit the
> "white
> space when we make a hide so I use the properties on: style.display.
>
> The script that I get (don't remember where) to do this is:
>
> <Script>
> function showDiv() {
> document.getElementById("div_name").style.display="none";
> }
> </Script>
>
> But with a script like this, no matter what I put in the repeat region, he
> will always look for the name that I have in this script, right?
>
> So... I have to put it dynamic, but for that I need to declare the counter
> before this script. After that can this be something like:
>
> <Script>
> function showDiv() {
> document.getElementById("div_name<?php echo
> $counter; ?>").style.display="block";
> }
> </Script>
>
> and also to hide:
>
> <Script>
> function hideDiv() {
> document.getElementById("div_name<?php echo
> $counter; ?>").style.display="none";
> }
> </Script>
>
>
> Result, of all this? No errors, but I have a very big white page with
> nothing
> in there!!!!!
>
> http://www.cantinho.org/admin/cantinho/find_search_result_v2.php
>
> Please.... have patience and help me out... I'm trying to learn, but this
> is
> my first steps in code.
>
>
> Thanks a lot.
Okay... Dreamweaver has that other behaviors panel, which contains a
Show/Hide Layer behavior, try practicing with that,
there's one catch with that behavior, to make it recognize your relatively
positioned div's you have to add style="position:relative" to the div.
The handcoding way would be to move your function into the head of the
document, and give it a parameter for the id of the object it should operate
on.
<script type="text/javascript">
<!--
function showDiv(id) {
document.getElementById(id).style.display="block";
}
function hideDiv(id) {
document.getElementById(id).style.display="none";
}
//-->
</script>
Then you pass it the id of the object to operate on like this
<a href="#" onCLick="showDiv('Layer<?php echo $counter; ?>');">show</a>
<a href="#" onCLick="hideDiv('Layer<?php echo $counter; ?>');">hide</a>
then again, the Show/Hide layer behavior provides you with UI integration in
Dreamweaver.
Joris
-
7. Re: Show Hide Inside a Repeat Region
oicram Sep 14, 2007 3:06 AM (in response to oicram)"Okay... Dreamweaver has that other behaviors panel, which contains a
I have several question concerning your last Post:
"Show/Hide Layer behavior, try practicing with that,
there's one catch with that behavior.
To make it recognize your relatively positioned div's you have to add style="position:relative" to the div."
I think I don't what him to recognize the "position relative" divs. At least I don't know why I should do that. I have done that, but the big white gap space does not desapear.
I have practice with the show/hide and with the effects panel also.
When I apply a glow effect to the dynamic image (inside the repeat region) he applies that effect FOR ALL IMAGES! :) I was so glad! But the show hide, or other effects conserning divs. No. :(
About the code:
Here is what I have in the HEAD section:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>find animal</title>
<?php $counter = 0; ?>
<Script>
function hidediv(div_name) {
document.getElementById("div_name").style.display="none";
}
function showdiv(div_name) {
document.getElementById("div_name").style.display="block";
}
</Script>
</head>
At the beginning of the repeat region I have this:
<?php do { ?> <!-- Repeat Region Beginning -->
<?php $counter = $counter + 1; ?>
And more inside the repeat region I have this:
<a href="#" onCLick="showdiv('div_name<?php echo $counter; ?>');">show</a>
<div id="div_name<?php echo $counter; ?>"> Something.</div>
AJAA<br />
ADA<br />
ADJAFJA<br />
AAFAF<br />
AFAFJAF<br />
AFAFAF<br />
AFAFAFAFAFAFAFAF<br />
AFAFAFKFAJAKFJAF<br />
aFAFAFAFAFAF<br />
:<?php echo $row_rs_procurar_animais['tipo_an']; ?></font>.<br />
</div>
<a href="#" onCLick="hidediv('div_name<?php echo $counter; ?>');">hide</a>
I'm still getting a blank page. :(((
-
8. Re: Show Hide Inside a Repeat Region
Newsgroup_User Sep 14, 2007 3:28 AM (in response to oicram)"oicram" <webforumsuser@macromedia.com> wrote in message
news:fcdmeo$9hf$1@forums.macromedia.com...
> "Okay... Dreamweaver has that other behaviors panel, which contains a
> I have several question concerning your last Post:
>
> "Show/Hide Layer behavior, try practicing with that,
> there's one catch with that behavior.
> To make it recognize your relatively positioned div's you have to add
> style="position:relative" to the div."
>
> I think I don't what him to recognize the "position relative" divs. At
> least I
> don't know why I should do that. I have done that, but the big white gap
> space
> does not desapear.
>
> I have practice with the show/hide and with the effects panel also.
> When I apply a glow effect to the dynamic image (inside the repeat region)
> he
> applies that effect FOR ALL IMAGES! :) I was so glad! But the show hide,
> or
> other effects conserning divs. No. :(
>
>
>
> About the code:
> Here is what I have in the HEAD section:
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
> <title>find animal</title>
>
>
> <?php $counter = 0; ?>
>
> <Script>
> function hidediv(div_name) {
> document.getElementById("div_name").style.display="none";
> }
> function showdiv(div_name) {
> document.getElementById("div_name").style.display="block";
> }
> </Script>
>
> </head>
>
> At the beginning of the repeat region I have this:
>
> <?php do { ?> <!-- Repeat Region Beginning -->
>
> <?php $counter = $counter + 1; ?>
>
>
> And more inside the repeat region I have this:
> <a href="#" onCLick="showdiv('div_name<?php echo $counter; ?>');">show</a>
> <div id="div_name<?php echo $counter; ?>"> Something.</div>
> AJAA<br />
> ADA<br />
> ADJAFJA<br />
> AAFAF<br />
> AFAFJAF<br />
> AFAFAF<br />
> AFAFAFAFAFAFAFAF<br />
> AFAFAFKFAJAKFJAF<br />
> aFAFAFAFAFAF<br />
> :<?php echo $row_rs_procurar_animais['tipo_an']; ?></font>.<br />
> </div>
> <a href="#" onCLick="hidediv('div_name<?php echo $counter; ?>');">hide</a>
>
>
> I'm still getting a blank page. :(((
The blank page
( http://www.cantinho.org/admin/cantinho/find_search_result_v2.php) is
because of the unclosed comment in a JavaScript
<Script> <!--Script para esconder layers.
you're missing
//-->
before
</script>
You'd want to have Dreamweaver to recognize those divs because it would be
impossible to select the "layer" to show/hide when applying the show hide
layer behavior. (oh crap it's called "Show-Hide Elements")
http://livedocs.adobe.com/en_US/Dreamweaver/9.0/help.html?content=WSc78c5058ca073340dcda91 10b1f693f21-79e0.html
-
9. Re: Show Hide Inside a Repeat Region
Newsgroup_User Sep 14, 2007 3:36 AM (in response to oicram)> You'd want to have Dreamweaver to recognize those divs because it would be
> impossible to select the "layer" to show/hide when applying the show hide
> layer behavior. (oh crap it's called "Show-Hide Elements")
>
> http://livedocs.adobe.com/en_US/Dreamweaver/9.0/help.html?content=WSc78c5058ca073340dcda91 10b1f693f21-79e0.html
oops I meant to link to
http://livedocs.adobe.com/en_US/Dreamweaver/9.0/WSc78c5058ca073340dcda9110b1f693f21-7af6.h tml
-
10. Re: Show Hide Inside a Repeat Region
oicram Sep 14, 2007 4:06 AM (in response to oicram)You'd want to have Dreamweaver to recognize those divs because it would be
impossible to select the "layer" to show/hide when applying the show hide
layer behavior. (oh crap it's called "Show-Hide Elements")
http://livedocs.adobe.com/en_US/Dreamweaver/9.0/help.html?content=WSc78c5058ca073340dcda91 10b1f693f21-79e0.html
"You'd want to have Dreamweaver to recognize those divs because it would be
impossible to select the "layer" to show/hide when applying the show hide
layer behavior."
Yes and he does that by the ID of the layer. But what is the relation with the:
"to make it recognize your relatively
positioned div's you have to add style="position:relative" to the div"
Why the position relative here?
The link that you have provide me I think its not related, it says:
"Set up a testing server"
Ok,
Thanks for the blank page issue. Not it show something, but he stills not working.
here: http://www.cantinho.org/admin/cantinho/find_search_result_v2.php
When I click hide:
I get a browser error saying "Object Required" in line 12.
And in line 12 I have:
function hidediv(div_name) {
what's happening now?
Thanks -
11. Re: Show Hide Inside a Repeat Region
Newsgroup_User Sep 14, 2007 4:20 AM (in response to oicram)
"oicram" <webforumsuser@macromedia.com> wrote in message
news:fcdpvt$d4i$1@forums.macromedia.com...
> You'd want to have Dreamweaver to recognize those divs because it would be
> impossible to select the "layer" to show/hide when applying the show hide
> layer behavior. (oh crap it's called "Show-Hide Elements")
>
>
> http://livedocs.adobe.com/en_US/Dreamweaver/9.0/help.html?content=WSc78c5058ca07
> 3340dcda9110b1f693f21-79e0.html
>
>
> "You'd want to have Dreamweaver to recognize those divs because it would
> be
> impossible to select the "layer" to show/hide when applying the show hide
> layer behavior."
>
> Yes and he does that by the ID of the layer. But what is the relation with
> the:
> "to make it recognize your relatively
> positioned div's you have to add style="position:relative" to the div"
>
> Why the position relative here?
Dreamweaver MX requires that to recognize the div as a "Layer", If the new
show-hide elements behavior works without that you can leave it out.
> The link that you have provide me I think its not related, it says:
> "Set up a testing server"
Yup that's another error or mine, I replied with the correct url.
http://livedocs.adobe.com/en_US/Dreamweaver/9.0/WSc78c5058ca073340dcda9110b1f693f21-7af6.h tml
Note to self: insert diagnostic routines in procedure "wake up" to verify
the level of caffeine after running the "input coffee" routine...
> Ok,
> Thanks for the blank page issue. Not it show something, but he stills not
> working.
> here: http://www.cantinho.org/admin/cantinho/find_search_result_v2.php
>
> When I click hide:
> I get a browser error saying "Object Required" in line 12.
> And in line 12 I have:
>
> function hidediv(div_name) {
>
you're not passing the function argument but a string containing the name of
the argument, probably my bug in code given earlier
function hidediv(div_name) {
document.getElementById(div_name).style.display="none";
}
function showdiv(div_name) {
document.getElementById(div_name).style.display="block";
}
-
12. Re: Show Hide Inside a Repeat Region
oicram Sep 14, 2007 5:35 AM (in response to oicram)Dreamweaver MX requires that to recognize the div as a "Layer", If the new
show-hide elements behavior works without that you can leave it out.
Ok. Yes it works. :)
And YES IT WORKS ALSO, FINALY!!
YO HU!!! Doing doing doing!!! :)
Thanks a lot!!!
Last question (I have two buttons to show and hide, how can I trogle with only one?)
Thanks a lot -
13. Re: Show Hide Inside a Repeat Region
Newsgroup_User Sep 14, 2007 6:14 AM (in response to oicram)"oicram" <webforumsuser@macromedia.com> wrote in message
news:fcdv78$ils$1@forums.macromedia.com...
> Dreamweaver MX requires that to recognize the div as a "Layer", If the new
> show-hide elements behavior works without that you can leave it out.
>
> Ok. Yes it works. :)
>
>
> And YES IT WORKS ALSO, FINALY!!
>
> YO HU!!! Doing doing doing!!! :)
>
> Thanks a lot!!!
>
>
>
> Last question (I have two buttons to show and hide, how can I trogle with
> only
> one?)
You'll have to test the objects current style and change it accordingly,
<script type="text/javascript">
<!--
function toggleDiv(id) {
var el = document.getElementById(id);
//this if/else may look weird to you, google for "ternary operation"
el.style.display=(el.style.display=="block") ? "none" : "block";
}
//-->
</script>
Neonix sells an extension for that,
http://www.neonix.net/dreamweaver_extensions/neonix_toggle_content/neonix_toggle_content.h tm
(I don't sell extensions yet, I just give them away for free)
http://www.dmxzone.com/MyZone.asp?userid=1750
http://www.artronics.nl/dreamweaver/
-
14. Re: Show Hide Inside a Repeat Region
oicram Sep 14, 2007 6:16 AM (in response to oicram)I have tried hide the layers onload but I have a problem.
If I do like this:
<body onload='hidediv(div_name)'>
or
<body onload="hidediv(div_name)">
The browser returns: "object div_name" indefined.
I think he is right because I have no div called div_name because in my name of the div I have: div_name<?php echo $counter; ?>
But if I do:
<body onload="hidediv('div_name<?php echo $counter; ?>')">
or
<body onload="hidediv(div_name<?php echo $counter; ?>)">
The browser returns:
div_name0 undefined. And its also true, because on load I have no div_name called div_name0. And the first div_name that I will have after doing the submit will be div_name1, and more, that will be not "onload".
How can we properly call the function on load?
Thanks once and once and once again. If you are tired of my questions I must understand.
When I first ask you this, I think for myself it should be something easy because is dreamweaver repeat regions with dreamweaver show/hide behaviors. But noooo... :S Hope you can have patience to all my questions.
-
15. Re: Show Hide Inside a Repeat Region
Newsgroup_User Sep 14, 2007 6:24 AM (in response to oicram)"oicram" <webforumsuser@macromedia.com> wrote in message
news:fce1ii$lad$1@forums.macromedia.com...
>I have tried hide the layers onload but I have a problem.
>
> If I do like this:
> <body onload='hidediv(div_name)'>
> or
> <body onload="hidediv(div_name)">
>
> The browser returns: "object div_name" indefined.
> I think he is right because I have no div called div_name because in my
> name
> of the div I have: div_name<?php echo $counter; ?>
>
> But if I do:
> <body onload="hidediv('div_name<?php echo $counter; ?>')">
> or
> <body onload="hidediv(div_name<?php echo $counter; ?>)">
>
> The browser returns:
> div_name0 undefined. And its also true, because on load I have no div_name
> called div_name0. And the first div_name that I will have after doing the
> submit will be div_name1, and more, that will be not "onload".
>
> How can we properly call the function on load?
>
>
> Thanks once and once and once again. If you are tired of my questions I
> must
> understand.
> When I first ask you this, I think for myself it should be something easy
> because is dreamweaver repeat regions with dreamweaver show/hide
> behaviors. But
> noooo... :S Hope you can have patience to all my questions.
function hidediv(div_name) {
--------------------------------Vno quotesV
document.getElementById(div_name).style.display="none";
}
function showdiv(div_name) {
document.getElementById(div_name).style.display="block";
------------------------------^no quotes^
}
-
16. Re: Show Hide Inside a Repeat Region
Newsgroup_User Sep 14, 2007 6:44 AM (in response to oicram)Joris van Lier wrote:
>>
>> Last question (I have two buttons to show and hide, how can I trogle
>> with only
>> one?)
>
>
> You'll have to test the objects current style and change it accordingly,
>
> <script type="text/javascript">
> <!--
> function toggleDiv(id) {
> var el = document.getElementById(id);
> //this if/else may look weird to you, google for "ternary operation"
> el.style.display=(el.style.display=="block") ? "none" : "block";
> }
> //-->
> </script>
<script type="text/javascript">
function toggleDiv(id) {
var el = document.getElementById(id);
//this if/else may look weird to you, google for "ternary operation"
el.style.display=(el.style.display=="block") ? "none" : "";
}
</script>
Settting display to "" makes the function available to all "id'd" elements.
And comments (<!-- //-->) within function definitions are not
recommended. It hides the definition from browsers that use the XHTML DTD
Mick -
17. Re: Show Hide Inside a Repeat Region
Newsgroup_User Sep 14, 2007 6:46 AM (in response to oicram)oicram wrote:
> I have tried hide the layers onload but I have a problem.
>
> If I do like this:
> <body onload='hidediv(div_name)'>
> or
> <body onload="hidediv(div_name)">
>
> The browser returns: "object div_name" indefined.
> I think he is right because I have no div called div_name because in my name
> of the div I have: div_name<?php echo $counter; ?>
>
> But if I do:
> <body onload="hidediv('div_name<?php echo $counter; ?>')">
> or
> <body onload="hidediv(div_name<?php echo $counter; ?>)">
>
> The browser returns:
> div_name0 undefined. And its also true, because on load I have no div_name
> called div_name0. And the first div_name that I will have after doing the
> submit will be div_name1, and more, that will be not "onload".
>
> How can we properly call the function on load?
>
>
> Thanks once and once and once again. If you are tired of my questions I must
> understand.
> When I first ask you this, I think for myself it should be something easy
> because is dreamweaver repeat regions with dreamweaver show/hide behaviors. But
> noooo... :S Hope you can have patience to all my questions.
>
>
>
>
Start $counter at 1
Mick -
18. Show Hide Inside a Repeat Region
oicram Sep 14, 2007 7:34 AM (in response to oicram)Joris:
I'm working on:
http://www.cantinho.org/admin/cantinho/find_search_result_v3.php
and this page have no quotes has you have told me in later posts. ;)
But the onload event don't trigger I don't know why.
Mick
Thanks for your commentaries
I have made the $counter start at 1 but it does not work either.
Thanks to both of you. -
19. Re: Show Hide Inside a Repeat Region
Newsgroup_User Sep 14, 2007 8:11 AM (in response to oicram)
"oicram" <webforumsuser@macromedia.com> wrote in message
news:fce657$qdf$1@forums.macromedia.com...
> Joris:
> I'm working on:
> http://www.cantinho.org/admin/cantinho/find_search_result_v3.php
>
> and this page have no quotes has you have told be in later posts. ;)
>
> But the onload event don't trigger I don't know why.
>
> Mick
> Thanks for your commentaries
> I have made the $counter start at 1 but it does not work either.
>
>
> Thanks to both of you.
You need to enclose the name of the div in quotes when you call the function
onLoad="hidediv('div_name1');"
-
20. Re: Show Hide Inside a Repeat Region
oicram Sep 14, 2007 8:46 AM (in response to oicram)I have done what you said but now he returns a error saying:
Object Required in Line 11.
And in line 11 I have this:
document.getElementById(div_name).style.display="none";
(no quotes like you said). -
21. Re: Show Hide Inside a Repeat Region
Newsgroup_User Sep 14, 2007 8:56 AM (in response to oicram)"oicram" <webforumsuser@macromedia.com> wrote in message
news:fceac5$1s8$1@forums.macromedia.com...
>I have done what you said but now he returns a error saying:
> Object Required in Line 11.
> And in line 11 I have this:
> document.getElementById(div_name).style.display="none";
>
> (no quotes like you said).
There is no div_name1 it starts at div_name2, I think you misinterpreted
Mick's reply to set the counter to 1 initially, however, you increment it by
1 BEFORE you reference it in the id atribute, so it starts at 2, move the
incrementation code to just before the end of the repeat region, or start at
0
And ... the first time the page is loaded (before submitting the form)
there's no div's at all...
-
22. Re: Show Hide Inside a Repeat Region
oicram Sep 14, 2007 9:27 AM (in response to oicram)Ok. I have put the counter back to 0.
And he starts hidding, but he only hides the first record.
I think its normal because I said:
<body onload="hidediv('div_name1');">
I have tried this code hoping that he will do this for all divs:
<body onload="hidediv('div_name<?php echo $counter; ?>');">
But he does not do for any of them.
How can we solve this?
"And ... the first time the page is loaded (before submitting the form)
there's no div's at all... "
Yes they are, but are hidden. This means that they aren't ?
If thats the case, how can we avoid the initial error?
Thanks -
23. Re: Show Hide Inside a Repeat Region
Newsgroup_User Sep 14, 2007 10:48 AM (in response to oicram)"oicram" <webforumsuser@macromedia.com> wrote in message
news:fcecqd$4i7$1@forums.macromedia.com...
> Ok. I have put the counter back to 0.
> And he starts hidding, but he only hides the first record.
> I think its normal because I said:
> <body onload="hidediv('div_name1');">
> I have tried this code hoping that he will do this for all divs:
> <body onload="hidediv('div_name<?php echo $counter; ?>');">
> But he does not do for any of them.
> How can we solve this?
> "And ... the first time the page is loaded (before submitting the form)
> there's no div's at all... "
>
> Yes they are, but are hidden. This means that they aren't ?
> If thats the case, how can we avoid the initial error?
>
> Thanks
Can't you just hide all your divs via CSS by default?
<div id="...." style="display:none;"></div>
-
24. Show Hide Inside a Repeat Region
oicram Sep 15, 2007 1:55 AM (in response to oicram)The problem is exactly the "..."
What to put there? What div should he hide?
<div id="...." style="display:none;"></div>
I have tried this, and it haven't work:
<style type="text/css">
<!--
#'div_name<?php echo $counter; ?>' { display: none; }
-->
</style>
Here is the link
Thanks...
-
25. Re: Show Hide Inside a Repeat Region
oicram Sep 15, 2007 3:32 AM (in response to oicram)In the sound of Doors music: "The End".
Let's make a resume of all this:
OBJECTIVE OF THIS "BIG" POST:
Make a show/hide details button inside a repeat region, so when user click on that button the details of that specific record inside the repeat region appear and disapear. (toggle).
WHAT WAS NOT WORKING?
1)
PROBLEM:
The effect (in the effects menu of dreamweaver) despite the fact that we click on toggle option, he DON'T toggle at all.
SOLUTION:
There is know bug in Spry effects.js file. We need to update the .js file so the .js can toggle.
Get it here: http://www.cristic.ro/samples/SpryEffects.js
Thanks Marin.
2)
PROBLEM:
The effect only happens on the first record, nothing happens on the other!
SOLUTION:
Sugestion from Joris:
Apply a php counter.
3)PROBLEM:
The initial state of the "details div" is SHOW but we need them to be HIDE. (so the details show, only when user whats to see them).
SOLUTION MISSED:
Apply a CSS like this:
<style type="text/css">
<!--
#div_name<?php echo $counter; ?> { display: none; }
-->
</style>
Why? (don't know, maybe because we can't apply a dynamic div name inside a CSS or maybe because I don't know how to do it)
SOLUTION THAT WORK:
Suggested by Joris again:
Apply to eatch particular div that you want to hide (since we have a repeat region it will be only one)
and apply at that div the style="display:none" property.
THANKS A LOT!!!!! JORIS!!! REALLY!!!!
Thanks for your time, your patience and, your lessons. :)

