Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
SmartyValidate textarea

 
Post new topic   Reply to topic    Smarty Forum Index -> Add-ons
View previous topic :: View next topic  
Author Message
thiebo
Smarty Pro


Joined: 16 Jan 2005
Posts: 132
Location: Paris

PostPosted: Fri Aug 01, 2014 5:02 am    Post subject: SmartyValidate textarea Reply with quote

Hello,

I have a form composed of several input types and in the end one textarea (which is not an HTML input type).

Smartyvalidate works great for the parts of the form that have an input type, but not for the textarea. In the case the form is not validly submitted, the text of the textarea is lost.

Here's my code :

Code:
<form method="post" action="index.php?l={$smarty.session.langue}">

<label for = "nom" class="formName">Name</label>
<input type="text" name="nom" value="{$nom|escape}"><br />

<span id="mess">   
{validate id="Nom" message="Please enter your name"}
 </span>

<label for ="email" class="formName">Email address</label>
<input type="text" name="email" size="30" value="{$email|escape}"><br />
<span id="mess">
{validate id="Email" message="Please enter a valid email address"}
</span>

<textarea name="message" class="formMessage" value="{$message|escape}"></textarea>
   <span id="mess">
{validate id="Message" message="Don't you have anything to write ...?"}
</span>



Is there any manner to keep the text inserted into the textarea in the case where the user has not provided a valid email address for example ? With the code above, only the name and email address are kept and the text is lost.

Many thanks,

Thiebo
Back to top
View user's profile Send private message Visit poster's website
AnrDaemon
Smarty Regular


Joined: 03 Dec 2012
Posts: 84

PostPosted: Wed Aug 06, 2014 11:55 am    Post subject: Reply with quote

Hint: textarea tag do not have value attribute.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Add-ons 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