View previous topic :: View next topic |
Author |
Message |
rajprithvi Smarty n00b
Joined: 12 May 2010 Posts: 4
|
|
Back to top |
|
douglassdavis Smarty Junkie
Joined: 21 Jan 2008 Posts: 541
|
Posted: Fri Jul 02, 2010 11:04 am Post subject: Re: ajax in smarty |
|
|
rajprithvi wrote: | how i use ajax in smarty template
or
i use an ajax file like simple php how i assign array to smarty variable, that array return from ajax |
Since javascript/ajax runs on the user's browser after smarty has already finished and sent the HTML to the user, you can do something like this to send an array back:
Code: |
<script type='text/javascript'>
var x = {$my_array|@json_encode}
{literal}
// put JQuery or prototype etc... code here to send from user's browser
// back to server.
{/literal}
<script>
|
|
|
Back to top |
|
rajprithvi Smarty n00b
Joined: 12 May 2010 Posts: 4
|
|
Back to top |
|
douglassdavis Smarty Junkie
Joined: 21 Jan 2008 Posts: 541
|
|
Back to top |
|
rajprithvi Smarty n00b
Joined: 12 May 2010 Posts: 4
|
|
Back to top |
|
douglassdavis Smarty Junkie
Joined: 21 Jan 2008 Posts: 541
|
Posted: Mon Jul 05, 2010 4:27 pm Post subject: |
|
|
You may change the delimiters if you want, the default is { and } so just use those. |
|
Back to top |
|
ucntkilme Smarty Regular
Joined: 03 Sep 2007 Posts: 84
|
Posted: Mon Jul 19, 2010 3:51 pm Post subject: |
|
|
Ajax within smarty is actually quite easy, i use it myself.. it's basically like adding in just some regular javascript except better!
I use the onclick, and for some text fields the onchange modifiers to activate my AJAX calls.
such as:
Code: |
<input type="submit" name="button" id="button" value="Submit" onclick="UpdateEditorFormValue(); doUpdate('form1', 'index.php', 'deals&act=add')"/>
|
in this code you can see i am using 2 functions inside my .tpl file on the submit button. UpdateEditorFormValue(); is javascript function to take the FCKeditor value and input it into the hidden field that FCKeditor creates upon pageload.
The code for that is:
Code: |
function UpdateEditorFormValue()
{
for ( i = 0; i < parent.frames.length; ++i )
if ( parent.frames[i].FCK )
parent.frames[i].FCK.UpdateLinkedField();
}
|
nice and simple on that, nothing special but it works. otherwise with ajax especially if you're also using formfield uploads you dont get any result back from your fckeditor but thats a different topic sorta.
k now we see that i am calling the 2nd function now, and this is where my ajax comes into place.
doUpdate('form1', 'index.php', 'deals&act=add')
this here is a function that I created to submit a form. The attributes are, form_name, url, and query.
The function for this is as follows:
Code: |
function doUpdate(formID, url, query)
{
var myRand = parseInt(Math.random()*99999999);
var query = query;
var url = url;
var srcs = url+"?pg="+query+"&ints="+myRand;
var pars = Form.serialize(formID);
$('TransMsgDisplay').innerHTML='<img src="../templates/admin/img/indicator.gif" align="center">';
var myAjax = new Ajax.Request(
srcs,
{
method: 'post',
parameters: pars,
onComplete: processUpdate
});
}
function processUpdate(originalRequest)
{
if(originalRequest.responseText == 0) {
document.location.href="index.php";
} else {
$('TransMsgDisplay').innerHTML=originalRequest.responseText;
}
}
|
Pretty simple eh?
and its not any harder to make it change navigation either.
Code: |
function AjaxObjectCreateGeneral()
{
var req; // The variable that makes Ajax possible!
try{
// Opera 8.0+, Firefox, Safari
req = new XMLHttpRequest();
} catch (e){
// Internet Explorer Browsers
try{
req = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try{
req = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e){
// Something went wrong
alert("Your browser broke!");
return false;
}
}
}
return req;
}
function changeNavigation(url) {
req=AjaxObjectCreateGeneral();
if(req) {
var myRand = parseInt(Math.random()*99999999);
var url = url;
var srcs = url+"&ints="+myRand;
$('TransMsgDisplay').innerHTML='<img src="../templates/admin/img/indicator.gif" align="center">';
req.onreadystatechange = processNavigation;
req.open("GET",srcs,true);
req.send();
}
}
function processNavigation()
{
if(req.readyState == 4)
{
if(req.status == 200)
{
if(req.responseText == 0) {
document.location.href="index.php";
} else {
document.getElementById("TransMsgDisplay").innerHTML=req.responseText;
}
}
}
}
|
the first ajax codeblock uses the prototype.js (latest stable release).. the second one does not. _________________ FCKit V1. : http://www.smarty.net/forums/viewtopic.php?t=17748 |
|
Back to top |
|
ucntkilme Smarty Regular
Joined: 03 Sep 2007 Posts: 84
|
Posted: Wed Jul 21, 2010 5:18 pm Post subject: |
|
|
Be careful when using ajax within smarty, ive had major headaches with it the last few days...
I would use regular methods for dealing with main navigation, but then you can use ajax for page interior navigation granted that interior page doesn't require any extra special javascript, jquery, ajax, etc...
I've recently used a jquery event calendar, which the way jquery works in its syntax conflicts with the prototype.js, so i had to correct that issue to get both things working...
if ya need further help getting ajax working in smarty let me know and i'll try to help you out. _________________ FCKit V1. : http://www.smarty.net/forums/viewtopic.php?t=17748 |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Wed Jul 21, 2010 5:25 pm Post subject: |
|
|
using ajax in smarty is no more complicated than using ajax in just php. ajax is handled in the browser after the fact. |
|
Back to top |
|
ucntkilme Smarty Regular
Joined: 03 Sep 2007 Posts: 84
|
Posted: Wed Jul 21, 2010 5:33 pm Post subject: |
|
|
That is true, however when you use ajax to do your main navigation, at least what i've found, is other javascript that needs to be called isnt included because the page isnt being rendered.
and if you do your smarty like me where i have a constructor.tpl which is the base of my navigation and a div to display the contents brought from ajax. if you include the JS files in the constructor.tpl the secondary page doesn't recognize the JS files as being there. _________________ FCKit V1. : http://www.smarty.net/forums/viewtopic.php?t=17748 |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Wed Jul 21, 2010 5:36 pm Post subject: |
|
|
its a matter of viewing the the browser source, and making sure smarty (or php) generates the needed output. |
|
Back to top |
|
ucntkilme Smarty Regular
Joined: 03 Sep 2007 Posts: 84
|
Posted: Wed Jul 21, 2010 5:41 pm Post subject: |
|
|
True, when i was personally trying to use ajax as my main navigation.
When the entire page was loaded, and i viewed the source (ie8), all i saw was the HTML for my constructor.
Which means its either an issue with not outputting the HTML for the page via ajax
Code: |
document.getElementById("TransMsgDisplay").innerHTML=req.responseText;
|
or the way i was rendering my template files in php itself.
Code: |
if ($page != "") {
$content = $aws->fetch('../templates/admin/'.$page);
if ($_int == '') { // this is not being called via an ajax call
$aws->assign('content', $content);
} else { // t his is being called via ajax
echo $content;
return $content;
}
}
if ($interface != '') {
$aws->display("../templates/admin/".$interface);
}
|
I've tried many different solutions to this issue, but none i tried worked. so i went back to regular href links ie: index.php?pg=deals&act=add _________________ FCKit V1. : http://www.smarty.net/forums/viewtopic.php?t=17748 |
|
Back to top |
|
ucntkilme Smarty Regular
Joined: 03 Sep 2007 Posts: 84
|
Posted: Wed Jul 21, 2010 5:55 pm Post subject: |
|
|
Just as a quick look here is my page output through ajax:
Code: |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta name="keywords" content="mysite.com Administration">
<meta name="Author" content="">
<link href="http://www.mysite.com/templates/admin/style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="http://www.mysite.com/inc/js/ajax.js"></script>
<script type="text/javascript" src="http://www.mysite.com/inc/js/ajax-dynamic-content.js"></script>
<script type="text/javascript" src="tab.js"></script>
<script language="javascript1.2" src="http://www.mysite.com/inc/js/general_functions.js"></script>
<script language="javascript1.2" src="http://www.mysite.com/inc/js/AjaxManager.js"></script>
<script language="javascript1.2" src="http://www.mysite.com/inc/js/functions_admin.js"></script>
<script language="javascript1.2" src="http://www.mysite.com/inc/js/functions.js"></script>
<script language="javascript1.2" src="http://www.mysite.com/inc/js/AjaxAdminGeneral.js"></script>
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<script language="javascript" src="http://www.mysite.com/inc/js/prototype.js" type="text/javascript"></script>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="100" align="center" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="1074"><table width="865" align="center" border="0" cellpadding="0" cellspacing="0" class="top_back">
<tr>
<td width="865" align="right" valign="middle" class="top_txt"><a href="index.php?pg=admin&act=default" class="top_link">My Account</a> | <a href="http://www.mysite.com" class="top_link">View Site</a> | <a href="index.php" onclick="doLogout(); return false;" class="top_link">Log out</a></td>
</tr>
</table></td>
</tr>
<tr>
<td width="1074"><table width="865" align="center" border="0" cellpadding="0" cellspacing="0" class="header_back">
<tr>
<td align="center" valign="middle" class="header_text"><img src="../templates/admin/img/logo.gif" align="middle"></td>
</tr>
</table></td>
</tr>
<tr>
<td width="1074"><table width="865" height="80" align="center" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="865" valign="top"><div id="dolphincontainer">
<div id="dolphinnav">
<ul>
<li><a href="index.php" rel="deals"><span>Deals</span></a></li>
<li><a href="index.php" rel="widgets"><span>Widgets & Pages</span></a></li>
<li><a href="index.php" rel="talkspot"><span>Talk Spot</span></a></li>
<li><a href="index.php" rel="users"><span>Users</span></a></li>
<li><a href="index.php" rel="admin"><span>Admin</span></a></li>
</ul>
</div>
<div id="dolphin_inner">
<div id="deals" class="innercontent">
<ul>
<li><a href="index.php?pg=deals"><span>View Deals</span></a></li>
<li><a href="index.php?pg=deals&act=add" onclick="changeNavigation('index.php?pg=deals&act=add'); return false;"><span>Add Deal</span></a></li>
</ul>
</div>
<div id="widgets" class="innercontent">
<ul>
</ul>
</div>
<div id="talkspot" class="innercontent">
<ul>
</ul>
</div>
<div id="users" class="innercontent">
<ul>
<li><a href="index.php?pg=users&act=employs"><span>Employees</span></a></li>
<li><a href="index.php?pg=users&act=customers"><span>Customers</span></a></li>
</ul>
</div>
<div id="admin" class="innercontent">
<ul>
</ul>
</div>
</div>
</div>
<script type="text/javascript">
//dolphintabs.init("ID_OF_TAB_MENU_ITSELF", SELECTED_INDEX)
//dolphintabs.init("dolphinnav",20)
ddtabmenu.definemenu("dolphinnav", 20)
</script></td>
</tr>
</table></td>
</tr>
<tr>
<td width="1074" height="24"> </td>
</tr>
<tr>
<td width="1074" align="center"></td>
</tr>
</table></td>
</tr>
<tr>
<td align="center"><span class="txt_body" id="TransMsgDisplay"/><table width="865" border="0" align="center" cellpadding="0" cellspacing="0" style="border:1px #cecece solid; background-color:#ffffff; ">
<tr>
<td width="865">
<table width="865" height="47" align="center" border="0" cellpadding="0" cellspacing="0" style=" background-color:#eeeeee; border-bottom:1px #dddddd solid;" >
<tr>
<td width="17" height="15"></td>
<td width="552" rowspan="3" align="left" valign="middle" class="bl_text1">Welcome</td>
<td width="146" rowspan="3"></td>
<td width="150" rowspan="3" align="left" valign="middle"></td>
</tr>
<tr>
<td height="23"></td>
</tr>
<tr>
<td height="15"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="865" height="230" align="center" valign="middle" class="bl_text1">Welcome to Your Biz Deals Administration Control Panel. <br/>
Please use the menu on the top to navigate the administration control panel.</td>
</tr>
</table> </span></td>
</tr>
</table>
</body>
</html>
|
and here is my code from index.php?pg=deals&act=add
Code: |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta name="keywords" content="Your Biz Deals Administration">
<meta name="Author" content="">
<link href="http://www.mysite.com/templates/admin/style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="http://www.mysite.com/inc/js/ajax.js"></script>
<script type="text/javascript" src="http://www.mysite.com/inc/js/ajax-dynamic-content.js"></script>
<script type="text/javascript" src="tab.js"></script>
<script language="javascript1.2" src="http://www.mysite.com/inc/js/general_functions.js"></script>
<script language="javascript1.2" src="http://www.mysite.com/inc/js/AjaxManager.js"></script>
<script language="javascript1.2" src="http://www.mysite.com/inc/js/functions_admin.js"></script>
<script language="javascript1.2" src="http://www.mysite.com/inc/js/functions.js"></script>
<script language="javascript1.2" src="http://www.mysite.com/inc/js/AjaxAdminGeneral.js"></script>
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<script language="javascript" src="http://www.mysite.com/inc/js/prototype.js" type="text/javascript"></script>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="100" align="center" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="1074"><table width="865" align="center" border="0" cellpadding="0" cellspacing="0" class="top_back">
<tr>
<td width="865" align="right" valign="middle" class="top_txt"><a href="index.php?pg=admin&act=default" class="top_link">My Account</a> | <a href="http://www.mysite.com" class="top_link">View Site</a> | <a href="index.php" onclick="doLogout(); return false;" class="top_link">Log out</a></td>
</tr>
</table></td>
</tr>
<tr>
<td width="1074"><table width="865" align="center" border="0" cellpadding="0" cellspacing="0" class="header_back">
<tr>
<td align="center" valign="middle" class="header_text"><img src="../templates/admin/img/logo.gif" align="middle"></td>
</tr>
</table></td>
</tr>
<tr>
<td width="1074"><table width="865" height="80" align="center" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="865" valign="top"><div id="dolphincontainer">
<div id="dolphinnav">
<ul>
<li><a href="index.php" rel="deals"><span>Deals</span></a></li>
<li><a href="index.php" rel="widgets"><span>Widgets & Pages</span></a></li>
<li><a href="index.php" rel="talkspot"><span>Talk Spot</span></a></li>
<li><a href="index.php" rel="users"><span>Users</span></a></li>
<li><a href="index.php" rel="admin"><span>Admin</span></a></li>
</ul>
</div>
<div id="dolphin_inner">
<div id="deals" class="innercontent">
<ul>
<li><a href="index.php?pg=deals"><span>View Deals</span></a></li>
<li><a href="index.php?pg=deals&act=add" onclick="changeNavigation('index.php?pg=deals&act=add'); return false;"><span>Add Deal</span></a></li>
</ul>
</div>
<div id="widgets" class="innercontent">
<ul>
</ul>
</div>
<div id="talkspot" class="innercontent">
<ul>
</ul>
</div>
<div id="users" class="innercontent">
<ul>
<li><a href="index.php?pg=users&act=employs"><span>Employees</span></a></li>
<li><a href="index.php?pg=users&act=customers"><span>Customers</span></a></li>
</ul>
</div>
<div id="admin" class="innercontent">
<ul>
</ul>
</div>
</div>
</div>
<script type="text/javascript">
//dolphintabs.init("ID_OF_TAB_MENU_ITSELF", SELECTED_INDEX)
//dolphintabs.init("dolphinnav",20)
ddtabmenu.definemenu("dolphinnav", 20)
</script></td>
</tr>
</table></td>
</tr>
<tr>
<td width="1074" height="24"> </td>
</tr>
<tr>
<td width="1074" align="center"></td>
</tr>
</table></td>
</tr>
<tr>
<td align="center"><span class="txt_body" id="TransMsgDisplay"/><html>
<head>
<title>Add New Events</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.pack.js"></script>
<link rel="stylesheet" href="http://www.mysite.com/datepick/jquery.datepick.css" type="text/css" media="screen" charset="utf-8" />
<script type="text/javascript" src="http://www.mysite.com/datepick/jquery.datepick.pack.js"></script>
<script type="text/javascript">
var $v =jQuery.noConflict();
$v(document).ready(function(){
//configure the date format to match mysql date
$v('#expiry').datepick({dateFormat: 'yyyy-mm-dd'});
$v('#start').datepick({dateFormat: 'yyyy-mm-dd'});
});
</script>
</head>
<body>
<table width="865" border="0" align="center" cellpadding="0" cellspacing="0" style="border:1px #cecece solid; background-color:#ffffff; ">
<tr>
<td width="865">
<table width="865" height="47" align="center" border="0" cellpadding="0" cellspacing="0" style=" background-color:#eeeeee; border-bottom:1px #dddddd solid;" >
<tr>
<td width="17" height="15"></td>
<td width="552" rowspan="3" align="left" valign="middle" class="bl_text1">ADD DEAL</td>
<td width="146" rowspan="3"></td>
<td width="150" rowspan="3" align="center" valign="middle"> </td>
</tr>
<tr>
<td height="23"></td>
</tr>
<tr>
<td height="15"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="865" height="230" align="left" valign="top" class="bl_text1"><p><br />
</p>
<form enctype="multipart/form-data" target="hiddenframe" id="form1" name="form1" method="post" action="uploads.php">
<table width="96%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="4" class="bl_text1"><blockquote>Customer Information:</blockquote></td>
</tr>
<tr>
<td colspan="4" class="maintext"> </td>
</tr>
<tr>
<td width="16%" class="maintext">First Name:</td>
<td width="28%" class="maintext"><label>
<input type="text" name="f_name" id="f_name" class="maintext"/>
</label></td>
<td width="16%" class="maintext">Last Name:</td>
<td width="40%" class="maintext"><label>
<input type="text" name="l_name" id="l_name" class="maintext" />
</label></td>
</tr>
<tr>
<td class="maintext"> </td>
<td class="maintext"> </td>
<td class="maintext"> </td>
<td class="maintext"> </td>
</tr>
<tr>
<td class="maintext">Email:</td>
<td class="maintext"><input name="email" type="text" class="maintext" id="email" size="30"/></td>
<td class="maintext">Website:</td>
<td class="maintext"><input name="website" type="text" class="maintext" id="website" size="40" /></td>
</tr>
<tr>
<td class="maintext"> </td>
<td class="maintext"> </td>
<td class="maintext"> </td>
<td class="maintext"> </td>
</tr>
<tr>
<td class="maintext">Phone:</td>
<td class="maintext"><input name="phone" type="text" class="maintext" id="phone" size="10"/></td>
<td class="maintext">Fax: </td>
<td class="maintext"><input name="fax" type="text" class="maintext" id="fax" size="10"/></td>
</tr>
<tr>
<td class="maintext"> </td>
<td class="maintext"> </td>
<td class="maintext"> </td>
<td class="maintext"> </td>
</tr>
<tr>
<td class="maintext">Address: </td>
<td class="maintext"><input name="street" type="text" class="maintext" id="street" size="30"/></td>
<td class="maintext">City, State, Zip: </td>
<td class="maintext"><input name="city" type="text" class="maintext" id="city" size="10"/>
,
<input name="state" type="text" class="maintext" id="state" size="1"/> <input name="zip" type="text" class="maintext" id="zip" size="5"/></td>
</tr>
<tr>
<td class="maintext"> </td>
<td class="maintext"> </td>
<td class="maintext"> </td>
<td class="maintext"> </td>
</tr>
<tr>
<td nowrap="nowrap" class="maintext">Business Name: </td>
<td class="maintext"><input name="business" type="text" class="maintext" id="business" size="30"/></td>
<td class="maintext"> </td>
<td class="maintext"> </td>
</tr>
<tr>
<td class="maintext"> </td>
<td class="maintext"> </td>
<td class="maintext"> </td>
<td class="maintext"> </td>
</tr>
<tr>
<td colspan="4" class="maintext"><blockquote class="bl_text1">Coupon Information:</blockquote></td>
</tr>
<tr>
<td colspan="4" class="maintext"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="13%" class="maintext">Deal Title: </td>
<td colspan="3"><input name="title" type="text" class="maintext" id="title" size="60"/></td>
</tr>
<tr>
<td class="maintext"> </td>
<td class="maintext"> </td>
<td class="maintext"> </td>
<td class="maintext"> </td>
</tr>
<tr>
<td class="maintext">Regular Price:</td>
<td width="13%" class="maintext">$
<input name="reg_price" type="text" class="maintext" id="reg_price" size="10"/></td>
<td width="12%" class="maintext">Sale Price:</td>
<td width="62%" class="maintext">$
<input name="sale_price" type="text" class="maintext" id="sale_price" size="10"/></td>
</tr>
<tr>
<td class="maintext"> </td>
<td colspan="3" class="maintext"> </td>
</tr>
<tr>
<td class="maintext">Image Folder: </td>
<td colspan="3" class="maintext"><input name="folder" type="text" class="maintext" id="folder" size="30"/>
<span class="red_text">*note: this is the folder images will be uploaded to.</span></td>
</tr>
<tr>
<td class="maintext"> </td>
<td colspan="3" class="maintext"> </td>
</tr>
<tr>
<td class="maintext">Image Upload : </td>
<td colspan="3" class="maintext"><input onChange="javascript: document.form1.submit();" type="file" name="filefieldname" id="filefieldname" />
<iframe name="hiddenframe" style="display:none" >Loading...</iframe>
<input name="upload_cnt" id="upload_cnt" type="hidden" value="0" />
</td>
</tr>
<tr>
<td class="maintext">Uploaded Files:</td>
<td colspan="3" class="maintext"><div name="files_list" id="files_list"></div></td>
</tr>
<tr>
<td class="maintext"> </td>
<td colspan="3" class="maintext"> </td>
</tr>
<tr>
<td class="maintext">Start Date: </td>
<td colspan="3" ><input id="start" name="start" size="10"></td>
</tr>
<tr>
<td class="maintext"> </td>
<td colspan="3"class="maintext" ><label>
<input type="checkbox" name="sdd" id="sdd">
Make deal secondary deal of the day</label></td>
</tr>
<tr>
<td class="maintext"> </td>
<td colspan="3" > </td>
</tr>
<tr>
<td class="maintext">Expiration Date:</td>
<td colspan="3" ><input id="expiry" name="expiry" size="10"></td>
</tr>
<tr>
<td class="maintext"> </td>
<td colspan="3" class="maintext"> </td>
</tr>
<tr>
<td class="maintext">Minimum Quantity: </td>
<td colspan="3" class="maintext"><input name="minimum" type="text" class="maintext" id="minimum" size="2"/></td>
</tr>
<tr>
<td class="maintext"> </td>
<td colspan="3" class="maintext"> </td>
</tr>
<tr>
<td class="maintext">About Deal</td>
<td colspan="3" class="maintext"></td>
</tr>
<tr>
<td colspan="4" align="center" class="maintext"><input type="hidden" id="about" name="about" value="" style="display:none" /><input type="hidden" id="about___Config" value="" style="display:none" /><iframe id="about___Frame" src="../inc/fckeditor/editor/fckeditor.html?InstanceName=about&Toolbar=Default" width="95%" height="400px" frameborder="0" scrolling="no"></iframe> </td>
</tr>
<tr>
<td class="maintext"> </td>
<td colspan="3" class="maintext"> </td>
</tr>
<tr>
<td class="maintext">Status: </td>
<td colspan="3" class="maintext"><select name="status">
<option label="Active" value="1">Active</option>
<option label="Suspended" value="0">Suspended</option>
</select>
</td>
</tr>
<tr>
<td class="maintext"> </td>
<td colspan="3" class="maintext"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="4" align="center" class="maintext"><input name="sact" type="hidden" id="sact" value="save" /> <input type="submit" name="button" id="button" value="Submit" onClick="UpdateEditorFormValue(); doUpdate('form1', 'index.php', 'deals&act=add')" class="rbuttons"/></td>
</tr>
<tr>
<td colspan="4" align="center" class="maintext"> </td>
</tr>
</table>
</form></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
</span></td>
</tr>
</table>
</body>
</html>
|
the ajax call doesnt parse the needed information so it doesn't show the new .tpl in the page source because the browser doesnt 'render' that .tpl file. running the navigation through ajax also stops the jquery calendar from running, because the browser isnt rendering the .tpl so the javascript isnt being added in.
and if i add the javascript:
Code: |
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.pack.js"></script>
<link rel="stylesheet" href="http://www.mysite.com/datepick/jquery.datepick.css" type="text/css" media="screen" charset="utf-8" />
<script type="text/javascript" src="http://www.mysite.com/datepick/jquery.datepick.pack.js"></script>
{literal}
<script type="text/javascript">
var $v =jQuery.noConflict();
$v(document).ready(function(){
//configure the date format to match mysql date
$v('#expiry').datepick({dateFormat: 'yyyy-mm-dd'});
$v('#start').datepick({dateFormat: 'yyyy-mm-dd'});
});
</script>
{/literal} |
into the constructor.tpl, prototype has an issue with it, even though i've added the noConflict(); command for jquery... _________________ FCKit V1. : http://www.smarty.net/forums/viewtopic.php?t=17748 |
|
Back to top |
|
|