Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2005-07-14 13:04:56
- lee
- Member
- From: Normandy, France
- Registered: 2004-06-17
- Posts: 831
Style Form error messages
When a form is submitted with missing compulsory fields an error message is displayed. Taken from Jeremie’s new comment form, see “Please enter your name”:
<div id="commentInputName">
<label>Your name: Please enter your name<br /><input type="text" name="name" value="" size="25" tabindex="2" />
</label>
</div>
The error message should be able to be styled (in red or something), but it isn’t. Can the the Txp code be changed to allow styling?
(Edit: updated code to display properly. :) -Mary)
Last edited by Mary (2006-03-19 09:36:24)
Offline
Re: Style Form error messages
It’s in function saveComment()
in comment.php
. The syntax is always graf(gTxt('comment_name_required')
so right now one’s can edit it inside the lang pack.
Someone will take a look at it (if no-one does, I will).
Offline
#3 2005-07-19 22:18:56
- lee
- Member
- From: Normandy, France
- Registered: 2004-06-17
- Posts: 831
Re: Style Form error messages
What do the admins think of this suggestion, isn’t having error messages highlighted in some way basic usability (defensive design)?
EDIT
Found a way to do it using the default comment form and a bit of css
Last edited by lee (2005-07-20 12:44:15)
Offline
#4 2005-11-11 01:37:42
- c41um
- New Member
- Registered: 2005-11-08
- Posts: 6
Re: Style Form error messages
I came across this problem as well – I think the error message should at least be wrapped in a <span class=“error”> or something similar. I’m probably going to hack my TxP code slightly to achieve this – it just seems obvious that TxP should do that by default.
Offline
Pages: 1