Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Confuse with this pieces of code in smarty

 
Post new topic   Reply to topic    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
littlelorly86
Smarty n00b


Joined: 02 Feb 2012
Posts: 2

PostPosted: Wed Feb 15, 2012 7:08 am    Post subject: Confuse with this pieces of code in smarty Reply with quote

I was asked to repair a page and i'm new to smarty. I found this code below:

Code:
{ fieldset class='submit'}
   { field type='submit' value='save'|language }
   { if $smarty.request.category_id && !$smarty.request.saved }
      { field type='cancel' value='cancel'|language name='cancel' url="`$smarty.server.PHP_SELF`?category=1" }
   { else }
      { field type='reset' name='reset' value='reset'|language }
   { /if }
{ /fieldset }


I am confuse why when i view the source of the page i found on the submit button there is an onlick event and an hidden input type.

This is the source code i got from the web page:
Code:
<fieldset class="submit">
   <input type="hidden" name="submit_buttons[]">
   <input type="submit" onclick="if (window.Disabled){ return false;} else {window.Disabled = true; }" class="button submit_button" value="Save">
   <input type="reset" class="button reset_button" value="Reset" name="reset">               
</fieldset>


I need the onclick to be remove in the submit button. How would i do that?
Back to top
View user's profile Send private message
rodneyrehm
Administrator


Joined: 30 Mar 2007
Posts: 698
Location: Germany, border to Switzerland

PostPosted: Wed Feb 15, 2012 8:47 am    Post subject: Reply with quote

look for the plugin acting on 'field'. Might be
* a function plugin in file plugins/function.field.php,
* a function plugin registered with register_function() or registerPlugin()
* a prefilter plugin registered with register_prefilter() or registerPlugin() or $autoload_filters (not necessarily having "field" in its name)
_________________
Twitter
Back to top
View user's profile Send private message Visit poster's website
rodneyrehm
Administrator


Joined: 30 Mar 2007
Posts: 698
Location: Germany, border to Switzerland

PostPosted: Wed Feb 15, 2012 9:17 am    Post subject: Reply with quote

Also see Question on stackoverflow
_________________
Twitter
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP