-
-
Save netcarver/2514197 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$contact_form = Form('ao2', './') | |
->setRenderer( $r ) // Tells the form which renderer to use to generate its output. | |
//->_show_submitted(true) // Causes the form to show submitted values | |
//->_show_html(true) // Causes the form's renderer to expose the generated HTML for the form. | |
//->_show_form_elements(true) // Causes the form to show its internal structure | |
//->_show_form_errors(true) | |
//->match('myContactFormValidator') // Adds a validator to the form. You can use a form-level validator to add complex inter-item validation. | |
->onSuccess('MySuccessHandler') | |
->novalidate() // Stop FF doing client-side evaluation whilst testing. | |
// Here come the form elements... | |
->add( Fieldset(l('tutkintotiedot'), 'tutkintotiedot') | |
->add( Select('tutkinto', l('tutkinto'), $tutkinnot)) | |
->add( Input('valmistumispvm', l('valmistumispvm')) | |
->required() | |
->validate('myDateValidator') | |
) | |
->add( Input('liittymispvm', l('liittymispvm')) | |
->required() | |
->validate('myLiittymisValidator') | |
) | |
) | |
->add( Fieldset(l('ammattiosasto'), 'ammattiosasto') | |
->add('<div class="helper">Suosittelemme, että annat Tehyn valita ammattiosastosi. Annamme sinulle sijaintiasi ja taustaasi parhaiten vastaavan ammattiosaston.</div>') | |
->add( Checkbox('valtuutan', l('valtuutan'), 'valtuutan')) | |
) | |
->add( Fieldset(l('tyosuhde'), 'tyosuhde') | |
->add( Radios('tyosuhde', '', $tyosuhde) | |
->required() | |
) | |
) | |
->add( Select('jasenlaji', l('jasenlaji'), $jasenlajit) | |
->enabledIf('tyosuhde.value=en_ole_tyossa_koska_olen') | |
) | |
->add( Fieldset(l('tyonantaja'), 'tyonantaja') | |
->enabledIf('tyosuhde.value=1') | |
->add( Input('tyonantaja', l('tyonantaja'))) | |
->add( Input('tyonantaja_osoite', l('tyonantaja_osoite'))) | |
->add( Input('tyonantaja_postinumero', l('tyonantaja_postinumero'))) | |
->add( Input('tyonantaja_postinumero', l('tyonantaja_postinumero')) | |
->validate('myPostinumeroValidator') | |
) | |
->add( Input('tyonantaja_puhelin', l('tyonantaja_puhelin'))) | |
->add( Select('tyoaika', l('tyoaika'), $tyoaika)) | |
) | |
->add( Fieldset(l('yritys'), 'yritys') | |
->enabledIf('tyosuhde.value=olen_sosiaali__ja_terveysalan_yrittaja') | |
->add( Input('ytunnus', l('ytunnus')) | |
->required() | |
) | |
->add( Select('paatoimisuus', l('paatoimisuus'), $paatoimisuus)) | |
->add( Select('yrityksen_koko', l('yrityksen_koko'), $yrityksen_koko) | |
->enabledIf('paatoimisuus.value=1') | |
) | |
) | |
->add( Submit('Seuraava') ) | |
->process() | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment