Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Show Hide Inside a Repeat Region

Guest
Sep 13, 2007 Sep 13, 2007

Copy link to clipboard

Copied

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,


TOPICS
Server side applications

Views

2.0K
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 13, 2007 Sep 13, 2007

Copy link to clipboard

Copied

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,
>
>
>
>


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 13, 2007 Sep 13, 2007

Copy link to clipboard

Copied

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.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 13, 2007 Sep 13, 2007

Copy link to clipboard

Copied

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



Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 13, 2007 Sep 13, 2007

Copy link to clipboard

Copied

Thanks a lot. I will test it and if I have any question I will post back. Thanks for your help.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 13, 2007 Sep 13, 2007

Copy link to clipboard

Copied

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



Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 13, 2007 Sep 13, 2007

Copy link to clipboard

Copied



"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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 14, 2007 Sep 14, 2007

Copy link to clipboard

Copied

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


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 14, 2007 Sep 14, 2007

Copy link to clipboard

Copied

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


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 14, 2007 Sep 14, 2007

Copy link to clipboard

Copied

> 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=WSc78c5058ca073340dcda9110b1f693f2...

oops I meant to link to
http://livedocs.adobe.com/en_US/Dreamweaver/9.0/WSc78c5058ca073340dcda9110b1f693f21-7af6.html

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 14, 2007 Sep 14, 2007

Copy link to clipboard

Copied

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=WSc78c5058ca073340dcda9110b1f693f2...


"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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 14, 2007 Sep 14, 2007

Copy link to clipboard

Copied



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

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";
}








Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 14, 2007 Sep 14, 2007

Copy link to clipboard

Copied

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 14, 2007 Sep 14, 2007

Copy link to clipboard

Copied

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

(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/


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 14, 2007 Sep 14, 2007

Copy link to clipboard

Copied

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.


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 14, 2007 Sep 14, 2007

Copy link to clipboard

Copied

"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^
}

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 14, 2007 Sep 14, 2007

Copy link to clipboard

Copied

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 14, 2007 Sep 14, 2007

Copy link to clipboard

Copied

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 14, 2007 Sep 14, 2007

Copy link to clipboard

Copied

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.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 14, 2007 Sep 14, 2007

Copy link to clipboard

Copied



"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');"

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 14, 2007 Sep 14, 2007

Copy link to clipboard

Copied

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 14, 2007 Sep 14, 2007

Copy link to clipboard

Copied

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 14, 2007 Sep 14, 2007

Copy link to clipboard

Copied

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 14, 2007 Sep 14, 2007

Copy link to clipboard

Copied

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 15, 2007 Sep 15, 2007

Copy link to clipboard

Copied

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


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines