473,387 Members | 1,528 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Problem in smarty section loop in smarty templates

Hello,
I'm working on smarty based project. I need to append one div with html and javascript code using jquery's .append() method. here is my code.

var addRowId = $("#addRowId").val();
$("#addMember").append("<div id='row"+addRowId + "'><div id='UserExist_"+addRowId+"' class='userExist'><\/div><div class='left leftFamily'>Add Family Member :<\/div><div class='right rightFamily'><div class='familyMemberImage' align='center'><img src='../images/blank-profilepic.png' name='memberImg_"+addRowId+"' id='memberImg_"+addRowId+"' width='20px' height='20px'\/><\/div><div class='familyMemberName'><input type='text' size='20' validate='required:true' name='memberName_"+addRowId+"' id='memberName_"+addRowId+"' class='member memberText'\/><\/div><div class='familyMemberRelation'><select validate='required:true' name='relationType_"+addRowId+"' id='relationType_"+addRowId+"' class='relation' ><option value=''>Select Relation</option> {/literal}"{section loop=$relationId name=secCombo}+"<option value={$relationId[secCombo]}>{$relationName[secCombo]}<\/option>"{/section} {literal}
+"<\/select>
<\/div><div class='familyMemberRemove'><a href='#' onclick='removeFormField(\"#row" + addRowId + "\"); return false;'>Remove<\/a><\/div><\/div><div class='clear'><\/div><input type='hidden' value='' size='20' name='lastSelected_"+addRowId+"' id='lastSelected_"+addRowId+"' class='memberId'\/><input type='hidden' value='' size='20' name='lastSelectedName_"+addRowId+"' id='lastSelectedName_"+addRowId+"' class='fMemberName'\/><input type='hidden' value='' name='familyMemAutoId_"+addRowId+"' id='familyMemAutoId_"+addRowId+"' class='familyAutoId' /><div class='nonfamilyMemberPart'><div id='userNotExist_"+addRowId+"' class='userNotExist'><\/div><div id='memberEmail_"+addRowId+"' class='nonfamilyMemberEmail'><div class='emailLable'><b>Email :</b><\/div><div><input type='text' value='' size='55' name='memberEmail_"+addRowId+"' id='memberEmail_"+addRowId+"' class='memberEmail memberText'\/><\/div><\/div><div class='hrLine'><hr/><\/div><\/div><\/div>");

everything worked fine under mozila and other browser except IE it gives me javascript error when i used a section loop inside javascript code i got syntax error in my dreamviewer cs5 but it worked fine under other browser. if i remove double quotes in last line of highlighted section ("+<select") it display none error but then code does not worked in all browser. So kindly tell me if i'm doing anything wrong in this code.
Sep 1 '11 #1
1 1189
dlite922
1,584 Expert 1GB
ensure your smarty code is in {literal} {/literal} tags.

Looks like you have your literal tags reversed.

Dan
Sep 1 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Rudy | last post by:
I am writing a program in VB.NET and as I was debugging a problem I noticed my For loop doesn't want to loop! I originally had a upper bound which was an expression and it wasn't working. WHen I...
2
by: David | last post by:
Hi, The data I am trying to print on the web looks as follows: Date 1 Record 1 Record 2 Record 3
5
nabh4u
by: nabh4u | last post by:
hi, i have a program where every thing is working properly. i have a vector with some values. i use iterators and delete a specific value in the vector. here the loop runs infinitely only for some...
1
by: metgharab.mestaghrab | last post by:
having developed this simple template engine for my own projects,the engine simply replaces the {replacable} tags with the appropriate value. the template file is read into a string variable...
22
by: pucca | last post by:
Hi !! This is my for loop: Shape shapes=new Shape; for(int i=0;i<shapes.length;i++) { System.out.println("\n"); shapes.printState(); area+=shapes.area(); ...
6
by: markus.litz | last post by:
Hello, I have a strange problem with some of my c++ code. I have a normal for- loop like this for(int i = 1; ..... on MS-Windows with a Microsoft compiler everything is alright, but when I...
11
by: kalar | last post by:
Hello, i have a problem with an infinite loop. I have got 4 arrays , each of them, have 5 integers the elements are from random funtcion, I don't want to have same elements in the arrays so i make...
12
by: Alien | last post by:
Hi, I created a while-loop which will basically go through each number in a string and list the positions of the desired number. For example suppose I have a string sa "12123124" and I want to...
4
by: aarusiva | last post by:
Hi everybody In my codes i am using two for loop (nested one) . i am taking values through param in that file but the loop is not creating problem for ten cyle but from 11 its giving problem its...
1
by: gayatrib | last post by:
I want to populate a dropdown menu like this: event.php $sql="select * from tbl_clientdetails"; $rs=$conn->Execute($sql); $client=$rs->getrows(); STemplate::assign('client',$client); ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.