PEAR Packages
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPEAR Packages

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old February 7th, 2007, 11:33 AM
jogger jogger is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 5 jogger User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
QuickForm: Adding rule to element added via html

I'm using...

Code:
$form->addElement('html','<div id="foo"><input type="text" name="title" /> [more html and so on...]</div>');


In an effort to create a slick form with a date picker and nice layout. I'm have three text inputs (title, date, comments) added this way and I want all of them to be required.

I've tried to add a rule the ordinary way but it doesnt work...

Code:
$form->addRule('title','Please enter a title','required',false,'client');


How do I add a required rule to each of the three fields?

Reply With Quote
  #2  
Old February 7th, 2007, 05:35 PM
wiesemann wiesemann is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 153 wiesemann User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 h 29 m 35 sec
Reputation Power: 2
RE: QuickForm: Adding rule to element added via html

1. The 'html' element is deprecated. Use the 'static' element.

2. QF rules work only for elements that you add via QA, e.g. $form->addElement('text', 'title', ...);

3. A possible solution for your problem: Use a group (=> addGroup()) with (e.g.) a 'text' element (named 'title') and a 'static' element (with the calendar JS code as the value).

4. For "jscalendar" you can find two working implementations for QF via Google. One solution works as a group (but can be used as a element), the other one is a new element that has only the JS code and needs an additional 'date' (or 'text') element.

Reply With Quote
  #3  
Old February 9th, 2007, 12:53 PM
jogger jogger is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 5 jogger User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: QuickForm: Adding rule to element added via html

Sorted, thanks mate!

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPEAR Packages > QuickForm: Adding rule to element added via html


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT