Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6147379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:06:04+00:00 2026-05-23T19:06:04+00:00

I’ve been browsing for answers for a while and I’ve given in to asking

  • 0

I’ve been browsing for answers for a while and I’ve given in to asking a question here. I have several working sf forms, but for some reason this one doesn’t want to do it. I have a feeling I am missing a small detail I’ve been lucky to overlook without errors in the past.

Here is the schema:

public function configure()
{

  //widgets
  $this->setWidgets(array(
    'study_area' => new sfWidgetFormSelect( array( 'label' => 'Select Study Area', 'choices' => self::study_areas() )),
    'degree_level' => new sfWidgetFormSelect( array( 'label' => 'Select Degree Level', 'choices' => self::degree_levels() )),
    'campusonline' => new sfWidgetFormSelectRadio( array( 'choices' => self::campus_online(), 'class' => 'radiolabel' )),
    'zip' => new sfWidgetFormInputText( array( 'label' => 'Zip code:')),
  ));

  //validators
  $this->setValidators(array(
    'study_area'   => new sfValidatorString( array( 'required' => true )),
    'degree_level' => new sfValidatorString( array( 'required' => true )),
    'campusonline' => new sfValidatorString( array( 'required' => true )),
    'zip'          => new sfValidatorString(array( 'required' => 'Please enter a valid zip.' )),
  ));

  //formatting, default values, name format, etc
  $this->getWidgetSchema()->getFormFormatter()->setRowFormat( '%label%%error%%field%%help%%hidden_fields%' );
  $this->setDefaults( array( 'study_area' => '', 'degree_level' => '', 'campusonline' => 1 ));
  $this->getWidgetSchema()->setLabel( 'campusonline', false );
  $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
  $this->validatorSchema['zip'] = new sfValidatorZip(array('required' => true));

}

And here is the action:

$this->form = new SearchWidgetForm();

if ($request->isMethod( 'post' ))
{
  $this->form->bind($request->getParameter( 'searchwidget' ));

  if ($this->form->isValid())
  {
    $this->redirect('@search_widget');
  }
  else
  {
    print 'nope';
    $this->form->debug();
    var_dump($request->getParameter( 'searchwidget' ));
    die;
  }
}

And here is what results from that else:

nope
study_area: Required.

degree_level: Required.

campusonline: Required.

zip: Required.

_csrf_token: Required.

null

I have also checked that var_dump( $this->form->isBound() ); produces ‘true’, which it does. So… The form is bound, but the array it should have become is null.

Any ideas?

Thanks in advance for any help. I would really appreciate it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T19:06:05+00:00Added an answer on May 23, 2026 at 7:06 pm

    I’m only guessing here, (haven’t used sf1.x in a bit) but maybe you need to set the form name format? I see you mentioned it in the last comment in your first code snippet, but I don’t see the actual line:

    $this->widgetSchema->setNameFormat('searchwidget[%s]');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
Seemingly simple, but I cannot find anything relevant on the web. What is the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.