problem with slashes in section

From: Date: Tue, 09 Sep 2003 17:51:47 +0000
Subject: problem with slashes in section
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-10181@lists.php.net to get a copy of this message
Hi I have a strange problem in my php i have this in a loop: $smarty->append('name', $row['name']); $smarty->append('slashed_name', addslashes($row['name'])); its the same thing except on is slashed and in my tpl i have this to generate some javascript: {section name=a_index loop=$slashed_name} if(document.formname.eventtype.options[document.formname.eventtype.selectedIndex].text == '{$slashed_name[a_index]}') MM_swapImage('thumb_image','','{$thumbnail[a_index]}',1); {/section} and then later on i populate a drop down list with the smarty array $name output comes out as this: if(document.formname.eventtype.options[document.formname.eventtype.selectedIndex].text == 'Girl's Night') MM_swapImage('thumb_image','','/images/blank.gif',1); for some reason the Girl's Night isnt slashed and its still causing javascript errors Any Ideas Thanks -Gerard

« previous php.smarty.general (#10181) next »