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

SmartyValidate textarea

 
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 -> Add-ons
View previous topic :: View next topic  
Author Message
thiebo
Smarty Pro


Joined: 16 Jan 2005
Posts: 144
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
Administrator


Joined: 03 Dec 2012
Posts: 1785

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