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

  • Home
  • SEARCH
  • 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 978695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T04:05:50+00:00 2026-05-16T04:05:50+00:00

The submit handler gets the same form values no matter what I put in

  • 0

The submit handler gets the same form values no matter what I put in the form. Why???????

function edit_schoolinfo_form() {
    global $user;
    $result = db_query("SELECT * FROM {db} where userid=%d", $user->uid);
    $sas_school_info = db_fetch_array($result);
    $form = array();
    $form['school'] = array('#type' => 'fieldset', '#title' => t('School Information'), '#weight' => - 17,);
    $form['school']['principlename'] = array('#type' => 'textfield', '#title' => t('Principle Name '), '#required' => TRUE, '#size' => 45, '#weight' => - 11, '#value' => $sas_school_info['principlename'],);
    $form['school']['schoolname'] = array('#type' => 'textfield', '#title' => t('School Name '), '#required' => TRUE, '#size' => 45, '#weight' => - 10,'#value' => $sas_school_info['schoolname'],);
    $form['school']['address1'] = array('#type' => 'textfield', '#title' => t('Address 1'), '#required' => TRUE, '#size' => 45, '#weight' => - 9.1,'#value' => $sas_school_info['address1'],);
    $form['school']['address2'] = array('#type' => 'textfield', '#title' => t('Address 2'), '#required' => FALSE, '#size' => 45, '#weight' => - 9,'#value' => $sas_school_info['address2'],);
    $form['school']['city'] = array('#type' => 'textfield', '#title' => t('City'), '#required' => TRUE, '#size' => 30, '#weight' => - 12, '#weight' => - 5.2,'#value' => $sas_school_info['city'],);

    $form['school']['state'] = array('#type' => 'select', '#options' => greenopolis_sasapp_states_list(), '#title' => t('State'), '#required' => TRUE, '#weight' => - 5.0,'#default_value'=>$sas_school_info['state'],);
    $form['school']['zipcode'] = array('#type' => 'textfield', '#title' => t('School Zip Code'), '#required' => TRUE, '#size' => 20, '#weight' => - 4.9,'#value' => $sas_school_info['zipcode'],);
    $form['school']['terminalid'] = array('#type' => 'hidden', '#title' => t('Terminal ID'), '#required' => TRUE, '#size' => 20, '#weight' => - 4.8, '#value' => $terminalid, '#disabled' => TRUE);


    $form['admin'] = array('#type' => 'fieldset', '#title' => t('School Administrator Contact Information'), '#weight' => - 16,);
    $form['admin']['adminfname'] = array('#type' => 'textfield', '#title' => t('Administrator First Name'), '#required' => TRUE, '#size' => 45,'#value' => $sas_school_info['admin_first_name'],);
    //   $form['account']['mail'] = array('#type' => 'textfield', '#title' => t('Administrator Email'), '#required' => TRUE, '#size' => 45,);
    $form['admin']['adminlname'] = array('#type' => 'textfield', '#title' => t('Administrator Last Name'), '#required' => TRUE, '#size' => 45,'#value' => $sas_school_info['admin_last_name'],);
    $form['admin']['phoneno'] = array('#type' => 'textfield', '#title' => t('Phone Number'), '#required' => TRUE, '#size' => 45,'#value' => $sas_school_info['admin_phone'],);
    //  $form['account']['name'] = array('#type' => 'textfield', '#title' => t('Username'), '#required' => TRUE, '#size' => 45,);
    // $form['account']['pass'] = array('#type' => 'password_confirm', '#size' => 25, '#description' => t(''), '#required' => TRUE);


    $form['submit'] = array('#type' => 'submit', '#value' => t('Save Information'));

    return $form;


} //end of the function



function edit_schoolinfo_form_submit($form_id, &$form_state) {


    $principlename = $form_state['values']['principlename'];
    $schoolname = $form_state['values']['schoolname'];
    $address1 = $form_state['values']['address1'];
    $address2 = $form_state['values']['address2'];
    $city = $form_state['values']['city'];
    $state = $form_state['values']['state'];
    $zipcode = $form_state['values']['zipcode'];
    $admin_first_name = $form_state['values']['adminfname'];
    $admin_last_name = $form_state['values']['adminlname'];
    $admin_email = $form_state['values']['mail'];
    $admin_phone = $form_state['values']['phoneno'];



}
  • 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-16T04:05:51+00:00Added an answer on May 16, 2026 at 4:05 am

    Use #default_value to set the stored values from the database, instead of #value. When you set #value, that will be the value regardless of what the user submits.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form, and a submit handler in jQuery. When the user submits
So Im trying to use jquery's .post function to submit a form and return
I am handling a form submit like this: $('#some-form').submit(function(ev) { var $form = $(this);
How to handle dynamically generated form submit in asp.net mvc? Form is dynamically created
I have the following code: var submitHandler = function ($link, $form, close) { var
I'm trying to submit a form (it's a dynamic form with fields added via
i am trying to submit 2 forms at the same time im trying to
The full story is I want to disable the submit button on a form's
I have a form using jquery validation plugin. My submit button has an ajax
I have a form and I try to submit it but nothing happens. I

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.