Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-19-2008, 05:09 PM
Senior Member
 
Join Date: Jan 2008
Location: chicago
Posts: 101
Default Zend_Form question

Code:
I have a login form loaded from the config file that consists of two input fields and a submit button. How can I add the attribute value="login" to this code? I also want to add a class name. How can I do this?

; general form metainformation
user.login.action = "/user/login"
user.login.method = "post"

; username element
user.login.elements.username.type = "text"
user.login.elements.username.options.validators.alnum.validator = "alnum"
user.login.elements.username.options.validators.regex.validator = "regex"
user.login.elements.username.options.validators.regex.options.pattern = "/^[a-z]/i"
user.login.elements.username.options.validators.strlen.validator = "StringLength"
user.login.elements.username.options.validators.strlen.options.min = "6"
user.login.elements.username.options.validators.strlen.options.max = "20"
user.login.elements.username.options.required = true
user.login.elements.username.options.filters.lower.filter = "StringToLower"

; password element
user.login.elements.password.type = "password"
user.login.elements.password.options.validators.strlen.validator = "StringLength"
user.login.elements.password.options.validators.strlen.options.min = "6"
user.login.elements.password.options.required = true

; submit element
user.login.elements.submit.type = "submit"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-19-2008, 09:20 PM
Junior Member
 
Join Date: Jul 2007
Posts: 3
Default

Code:
user.login.elements.username.options.value = "login"
user.login.elements.username.options.class = "....."
How can I add a custom error message in config file?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-04-2008, 04:41 PM
Junior Member
 
Join Date: Mar 2008
Posts: 6
Default

Quote:
Originally Posted by misaak View Post
Code:
user.login.elements.username.options.value = "login"
user.login.elements.username.options.class = "....."
This works for value, but when looking at the generated HTML source, the class attribute is stated but left empty...

For example,

Code:
; submit element
generic.error_report.elements.submit.type = "submit"
generic.error_report.elements.submit.options.value = "Submit Error Report"
generic.error_report.elements.submit.options.class = "testclass"
generates...

Code:
<input type="submit" name="submit" id="submit" value="Submit Error Report" class="" />
Does anybody know if this is a known bug, or is my config syntax incorrect?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 01:25 PM.