Form Example

10 views
Skip to first unread message

jhead

unread,
Apr 21, 2008, 3:12:44 PM4/21/08
to PHP-Ext
I have uploaded a screen shot of my first use of PHP-Ext
(signUpForm.jpg). The non-AJAX application is for election workers,
in my county, to sign up for training at the college, where I
administer most web services.

Some notes on its deployment:
Toa put space between the radio button sets I purt a <br /> tag in the
label section since I don't know of another way to put a spacer in -
it causes some misslignments, but works:

$sectionType2 =
PhpExt_Form_Radio::createRadio("positionOptions","Judge or Extra
Worker <br />",null,"Vote Center and e-Pollbook");


The 'Next' submit button is accompinyed by a non-functional 'Cancl'
button, because when I try to just have a submit button, it doesn't
show up for some reason.

->addButton(PhpExt_Button::createTextButton("Next",
new PhpExt_Handler(
// Set the form's action to the corresponding URL
PhpExt_Javascript::stm('simple.getForm().getEl().dom.action =
"signUp.php"'),
// Call for submit on the underlying BasicForm object, it
should do normal submit if standardSubmit == true
PhpExt_Javascript::stm('simple.getForm().submit()')
)
));

$simple->addButton(PhpExt_Button::createTextButton("Cancel"));


The second password field is commented out as of now, because I'm not
aware of an easy way to make sure the fields are the same (not to say
PHP-Ext can't do it itself, but I'm not familiar enough with the whole
system to be sure).

$passwd1 =
PhpExt_Form_PassworField::createPasswordField("passwd1","Password")
->setMinLength(7)
->setMinLengthText("The Password must be 7 or more characters")
->setAllowBlank(false);
//$passwd2 =
PhpExt_Form_PassworField::createPasswordField("passwd2","Confirm
Password")
//->setAllowBlank(false);


On the whole I am happy to have a form with good aesthetics and not
have to deal with Javascript directly.

Some Ext-JS validation possibilities that could be integrated(?):
http://extjs.com/learn/Plugin:RemoteValidator

Perhaps some more useful info here?:
http://extjs.com/learn/Special:Search?search=validation&go=Go
Reply all
Reply to author
Forward
0 new messages