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

question to forms

 
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 -> General
View previous topic :: View next topic  
Author Message
holunda
Smarty Rookie


Joined: 27 Jun 2003
Posts: 28
Location: Austria > Tyrol

PostPosted: Fri Jun 27, 2003 8:42 am    Post subject: question to forms Reply with quote

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
View user's profile Send private message
Enquest
Smarty Regular


Joined: 14 May 2003
Posts: 79

PostPosted: Fri Jun 27, 2003 1:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
holunda
Smarty Rookie


Joined: 27 Jun 2003
Posts: 28
Location: Austria > Tyrol

PostPosted: Fri Jun 27, 2003 2:36 pm    Post subject: Reply with quote

Can you please go into detail a bit?
Can you show me a code snipet of you?
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Fri Jun 27, 2003 2:55 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
holunda
Smarty Rookie


Joined: 27 Jun 2003
Posts: 28
Location: Austria > Tyrol

PostPosted: Sun Jun 29, 2003 8:17 pm    Post subject: Reply with quote

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
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 -> 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