|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
holunda Smarty Rookie
Joined: 27 Jun 2003 Posts: 28 Location: Austria > Tyrol
|
Posted: Fri Jun 27, 2003 8:42 am Post subject: question to forms |
|
|
HI guys!
I have a question dealing with forms.
How do you display forms?
Like this:
Name: {$name}
or this:
Name: <input type="{$type_name}" name="{$name_name}" value=" .... and so on
It is my first project with Smarty ....
thx alex |
|
Back to top |
|
Enquest Smarty Regular
Joined: 14 May 2003 Posts: 79
|
Posted: Fri Jun 27, 2003 1:41 pm Post subject: |
|
|
Depends on what the sting $name has. It could have the complete string for an input.
But I gues you just want to do the following.
name: : <input type="name" name="name" value"{$name"}>
Remeber smarty is mainly HTML edit only where its needed you can pull some variables. I can harly imagine to make some monster as <input type={$type_name}...
So just use your html tags.
And call the variables in you PHP script after the form is procesed. _________________ -----------------------
Learning my self by trying to help others |
|
Back to top |
|
holunda Smarty Rookie
Joined: 27 Jun 2003 Posts: 28 Location: Austria > Tyrol
|
Posted: Fri Jun 27, 2003 2:36 pm Post subject: |
|
|
Can you please go into detail a bit?
Can you show me a code snipet of you? |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri Jun 27, 2003 2:55 pm Post subject: |
|
|
I always make it a habit to HTML escape vars in HTML forms.
<input type="text" name="author" value="{$author|escape}">
<textarea name="desc">{$desc|escape}</textarea>
This way if you have quotes, <>, etc. in your variables it won't break stuff.
Monte |
|
Back to top |
|
holunda Smarty Rookie
Joined: 27 Jun 2003 Posts: 28 Location: Austria > Tyrol
|
Posted: Sun Jun 29, 2003 8:17 pm Post subject: |
|
|
How would you create kind of a web assistant with 2-3 forms?
I had tried it, but it didnt work.
Can you give me maybe a example?
thx Alex |
|
Back to top |
|
|
|
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
|