Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

help~~~ how to create html button in smarty template??

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Tips and Tricks
View previous topic :: View next topic  
Author Message
fl
Smarty n00b


Joined: 15 Aug 2003
Posts: 1

PostPosted: Fri Aug 15, 2003 9:46 am    Post subject: help~~~ how to create html button in smarty template?? Reply with quote

hi all,

I'm new to smarty, and I wanna create a button like those in html (not checkbox or radio button) but don't know how to do it.

when the button is pressed, it will open another php file...

thx for any help
Back to top
View user's profile Send private message
CirTap
Smarty Pro


Joined: 04 Jun 2003
Posts: 106

PostPosted: Fri Aug 15, 2003 10:08 am    Post subject: Reply with quote

Hi,
if the "button" is in a <form> use some vanilla submit button, if it's a <button> you'd need JavaScript to load/locate the other file.
Quote:
<html>
<body>
<!-- regular submit button -->
<form action="otherfile.php">
<input type="submit" />
</form>

<!-- javascript BUTTON >
<button onclick="self.location.href=('otherfile.php')">Go</button>
</body>
</html>


'otherfile.php' can be a Smarty variable as well:
In your PHP File: $smarty->assign('GoToFile', 'otherfile.php');
In your template: action="{$GoToFile}" ... or self.location.href=('{$GoToFile}')
Watch out the double and single quotes! They belong to/are required by either HTML or JavaScript

Have fun,
CirTap
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Tips and Tricks 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