# Why is my 'show more' button displaying the wrong text?

**URL:** <https://forum.wixstudio.com/t/why-is-my-show-more-button-displaying-the-wrong-text/24698>\
**Category:** Ask the community\
**Tags:** code, question\
**Created:** [February 23, 2020, 5:16pm UTC](https://forum.wixstudio.com/t/why-is-my-show-more-button-displaying-the-wrong-text/24698 "2020-02-23T17:16:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sallyvalentine2016](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/sallyvalentine2016/32/10039_2.png) [@sallyvalentine2016](https://forum.wixstudio.com/u/sallyvalentine2016)\
**Post date:** [February 23, 2020, 5:16pm UTC](https://forum.wixstudio.com/t/why-is-my-show-more-button-displaying-the-wrong-text/24698/1 "2020-02-23T17:16:49Z")

</div>

I am new to using Corvid on Wix and have been using the tutorials to try to create 3 expandable text boxes using ‘show more’ buttons. However, although I can get the text to be shortened with the ellipses - the only ‘show more’ button that works (button 14) displays the text from a different box (“text 23” not “text 19” as it should). So not sure what I am doing wrong?

 ![](https://us1.discourse-cdn.com/wix/original/3X/4/7/47cb52766c096df43fd60b999f5b9d473025e9a5.png)

 ![](https://us1.discourse-cdn.com/wix/original/3X/4/2/425308fba10a6c048047e9c7477570d74282d750.png)

 ![](https://us1.discourse-cdn.com/wix/original/3X/9/8/982fdfd2b37a8ea3dee9bf75f04d77bf157b7a2f.png)

---

<div class="post-metadata">

**Author:** ![yisrael-wix](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/yisrael-wix/32/1107_2.png) [@yisrael-wix](https://forum.wixstudio.com/u/yisrael-wix)\
**Post date:** [February 23, 2020, 5:25pm UTC](https://forum.wixstudio.com/t/why-is-my-show-more-button-displaying-the-wrong-text/24698/2 "2020-02-23T17:25:42Z")

</div>

You also need fullText and shortText specific to each text box or the different texts will overwrite.

gentle reminder: Please observe the [Community Guidelines](https://www.wix.com/corvid/forum/community-discussion/corvid-community-guidelines) and post your code code, nicely formatted, in code blocks so that we can easily read the code.

---

<div class="post-metadata">

**Author:** ![sallyvalentine2016](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/sallyvalentine2016/32/10039_2.png) [@sallyvalentine2016](https://forum.wixstudio.com/u/sallyvalentine2016)\
**Post date:** [February 23, 2020, 5:38pm UTC](https://forum.wixstudio.com/t/why-is-my-show-more-button-displaying-the-wrong-text/24698/3 "2020-02-23T17:38:37Z")

</div>

Oh, sorry - wasn’t sure what a code block meant. When you say “fullText and shortText specific to each text box” is that not what I have done below?

```javascript
$w.onReady(function () {
// how many characters to include in the shortened version
const shortTextLength = 40; // you can change this number
// read the full text and store it in the fullText variable
fullText = $w("#text17").text;
// grab the number of characters defined in shortTextLength and store them in the shortText variable
shortText = fullText.substr(0, shortTextLength) + "...";
// set the contents of the text element to be the short text
$w("#text17").text = shortText;
});

```

```javascript
export function button13_click(event) {//make sure you have added the onClick event in properties
// check the contents of the text element
if ($w("#text17").text === shortText) {
// if currently displaying short text, display the full text
$w("#text17").text = fullText;
$w("#button13").label = "Show less";
} else {
// if currently displaying full text, display the short text
$w("#text17").text = shortText;
$w("#button13").label = "Show more";
}
}

```

---

<div class="post-metadata">

**Author:** ![yisrael-wix](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/yisrael-wix/32/1107_2.png) [@yisrael-wix](https://forum.wixstudio.com/u/yisrael-wix)\
**Post date:** [February 23, 2020, 5:52pm UTC](https://forum.wixstudio.com/t/why-is-my-show-more-button-displaying-the-wrong-text/24698/4 "2020-02-23T17:52:02Z")

</div>

Yes, but you stated that the text that gets displayed is from the wrong box. You wlll need fullText and shortText for each text box. Something like this:

```javascript
let fullText1;
let fullText2;
let fullText3;

let shortText1;
let shortText2;
let shortText3;

```

In this way, each block of text is handled completely separately.

---

<div class="post-metadata">

**Author:** ![sallyvalentine2016](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/sallyvalentine2016/32/10039_2.png) [@sallyvalentine2016](https://forum.wixstudio.com/u/sallyvalentine2016)\
**Post date:** [February 23, 2020, 6:22pm UTC](https://forum.wixstudio.com/t/why-is-my-show-more-button-displaying-the-wrong-text/24698/5 "2020-02-23T18:22:00Z")

</div>

@yisrael-wix thanks - that seems to have solved it!

---

<div class="post-metadata">

**Author:** ![givemeawhisky](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/givemeawhisky/32/5383_2.png) [@givemeawhisky](https://forum.wixstudio.com/u/givemeawhisky)\
**Post date:** [February 23, 2020, 6:45pm UTC](https://forum.wixstudio.com/t/why-is-my-show-more-button-displaying-the-wrong-text/24698/6 "2020-02-23T18:45:25Z")

</div>

Sally, as Yisrael has mentioned about the Forum Guidelines, note that in there is a statement about searching the forum for previous posts on your issue.

```javascript
Posting guidelines:
Search Before Posting. Use the Forum search. There's a great chance that someone has already solved the problem that you are facing. If you post a question that has already been asked and answered, your post may be locked. You might find the answer to your question by searching the Corvid documentation.

```

This show more/show less toggle and show button tutorial has been asked about in previous forum posts so many times that it could have it’s own forum section 😉😁

It wouldn’t be too bad if it at least had a little statement somewhere about using it for multiple occurences and then it wouldn’t be asked so many time in this forum like here.

> **[Creating multiple show-more/show-less links | Velo by Wix](https://community.wix.com/velo/forum/coding-with-velo/creating-multiple-show-more-show-less-links)**
>
> Hi!
> 
> I'am trying to figure out how to add multiple show-more links. I'am not super into code so don't blame me, I tried hahah. This is the code I got so far but issn't working.
> 
> let fullText; // variable to hold the full text
> let shortText; //...

> **[\[SOLVED\] Adding several expandable Text Boxes with Read More Links | Velo by Wix](https://community.wix.com/velo/forum/coding-with-velo/adding-several-expandable-text-boxes-with-read-more-links)**
>
> Hello, 
> I am willing to create a page with several expandable text boxes with read more buttons. The texts are static. So far, I managed to create one with the Corvid tutorial, but I don't know where I should add the code for the other text boxes and...

Anyways, glad it is sorted for you now.

---

<div class="post-metadata">

**Author:** ![sallyvalentine2016](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/sallyvalentine2016/32/10039_2.png) [@sallyvalentine2016](https://forum.wixstudio.com/u/sallyvalentine2016)\
**Post date:** [February 23, 2020, 7:02pm UTC](https://forum.wixstudio.com/t/why-is-my-show-more-button-displaying-the-wrong-text/24698/7 "2020-02-23T19:02:25Z")

</div>

@givemeawhisky Sorry about that - I honestly didn’t think there would be an issue with multiple versus single expandable boxes. Very new to Corvid and coding in general. Will double check next time.
