473,387 Members | 1,512 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.

smarty

hello friends.......... i am new to smarty. can anyone please tell me how to get the value from a dynamically generated checkbox using smarty. this is the code i used... here i am generating 10 checkbox. but i am not getting the value when each checkbox is checked. the value is coming from the array $profservices. how can i get the value from each checkbox when they are selected. also i have a "Select all" checkbox generated. how will i write its code. ie: how can i get all the checkbox dynamically generated selected when clicking the "select all"checkbox.


Expand|Select|Wrap|Line Numbers
  1. {section name=ckbox loop=$profservices}
  2.                 {if $smarty.section.ckbox.index==$profserv}
  3.                 <tr><td>
  4.                 <input type="checkbox" checked="checked" value="{$smarty.section.ckbox.index}" disabled="disabled" name="ckbx">{$profservices[ckbox]}</td></tr>
  5.                 {/if}
  6.                 {if $smarty.section.ckbox.index >='4' and $smarty.section.ckbox.index <='7'}
  7.                 <tr><td><input type="checkbox" value="{$smarty.section.ckbox.index}" checked="checked" name="ckbx">{$profservices[ckbox]}</td></tr>
  8.                 {/if}
  9.         {if $smarty.section.ckbox.index!=$profserv and $smarty.section.ckbox.index!='4' and $smarty.section.ckbox.index !='5' and $smarty.section.ckbox.index!='6' and $smarty.section.ckbox.index !='7'}
  10.                 <tr><td><input type="checkbox" value="{$smarty.section.ckbox.index}" name="ckbx">{$profservices[$smarty.section.ckbox.index]}</td></tr>
  11.  
  12.                 {/if}
  13.  
  14.  
  15.                   {/section}
  16.  
Thanks
Oct 14 '08 #1
1 2583
dlite922
1,584 Expert 1GB
this doesn't have much to do with smarty, once the page load, smarty and PHP are done doing their thing, you need to use JavaScript.

Dan
Oct 15 '08 #2

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

Similar topics

4
by: Brian | last post by:
Hello, I am trying to work out how to have smarty use a string's contents as the display-> template.. ie: $smarty->display($buffer); obviously $buffer isn't a filename, but a smarty template...
2
by: Daan | last post by:
Hello all, I'm having a little problem with Smarty. Getting it to work in a simple case went fine, but now I have the following situation: / /smarty /templates template.tpl /templates_c
1
by: Richard | last post by:
I need help. I have a smarty based program that I am modifying. I have a smarty template file that consists of smarty and HTML. I need to integrate some PHP database calls into it. My problem...
1
by: DJ Majestik | last post by:
OK, I am new to the whole PEAR/Smarty templating thing. I am trying to setup my directory structure correctly. If someone could weigh in and see if I have this setup "right", I would appreciate it....
2
by: M | last post by:
Hi Folks, I am trying to install Smarty using PHP 5 on a Windows XP PC using IIS v6 The following PHP File: <!doctype html public "-//W3C//DTD HTML 4.0 //EN"> <html> <head>
0
by: Matt | last post by:
geez, i've done this a million times, you'd think i could get it right. uploading to production server for a new site, and part of the head.inc that starts everything up looks like this: echo...
0
by: Conrad | last post by:
Hi, I'm very new to Smarty Template Engine and I'm using PHP 5.0.4 on the Windows XP Professional platform and I have the following question: When I change the 7th line of the script to use a...
0
by: ev45ive | last post by:
Hi! I have smth. like this: file.php: <?php SmartyValidate::connect($smarty); //SmartyValidate::register_form('register');
0
by: grezlik | last post by:
Hi! I have major problems with cakephp & smarty, (cake ver is 1.2 and smarty 2.6.18 ) there is a code (from cake/libs/view/view.php class SmartyView { .. .. ..
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...

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.