|
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 |
thiebo Smarty Pro
Joined: 16 Jan 2005 Posts: 144 Location: Paris
|
Posted: Fri Aug 01, 2014 5:02 am Post subject: SmartyValidate textarea |
|
|
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 |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Wed Aug 06, 2014 11:55 am Post subject: |
|
|
Hint: textarea tag do not have value attribute. |
|
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
|