---
title: "Jquery Tabs not working within the cycle for"  
description: "Jquery Tabs not working within the cycle for"  
author: "Anonymous User"  
published: 2013-08-16  
updated: 2013-08-19  
canonical: https://www.mindstick.com/forum/1391/jquery-tabs-not-working-within-the-cycle-for  
category: "jquery"  
tags: ["jquery"]  
reading_time: 1 minute  

---

# Jquery Tabs not working within the cycle for

Hi [developers](https://www.mindstick.com/articles/12875/blunders-you-must-avoid-while-hiring-java-developers-to-get-the-best-fulfilling-your-needs)!

This is my [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii): -[script](https://www.mindstick.com/interview/477/how-can-i-execute-a-php-script-using-command-line):

```
<script>       $(function() {       $(
"#tabs" ).tabs();       });     </script>
```

-[HTML](https://www.mindstick.com/articles/1530/design-a-simple-stylish-calculator-using-html-css-and-javascript):

```
for($i=0;$i<$num_panels;$i++)    {       
$data0=pg_fetch_row($result0);       
$name=$data0[5];       
$label_name=$data0[6];       
$script_link=$data0[7];        echo
"<div id=\"tabs\" width=\"590px\">";        echo
"<ul><li>";        echo
"<a href=\"#tabs-\".$i> $name </a>";        echo
"</li>";        echo
"</ul>";        echo
"<div id=\"tabs-\".$i>           
<p>hnckbrg</p>           
</div> ";           }        echo
"</div>";
```

this code is only generating the first tab. I do not know how to solve. can you help me?

## Replies

### Reply by Vijay Shukla

I notice a problem with the generated HTML:

```
echo "<a href=\"#tabs-\".$i> $name </a>";echo "</li>";echo "</ul>";echo "<div id=\"tabs-\".$i>Would result in the following HTML:<a href="tabs-"1>Name</a></li></ul><div id="tabs-"1>...
```

Notice how the id's are "tabs-"[Number] as opposed to "tabs-[Number]". Same problem with the href. This might be it or at least part of it.


---

Original Source: https://www.mindstick.com/forum/1391/jquery-tabs-not-working-within-the-cycle-for

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
