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 6158577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:58:48+00:00 2026-05-23T20:58:48+00:00

On 2 of my elements in a form, I am receiving ‘undefined’ in firebug.

  • 0

On 2 of my elements in a form, I am receiving ‘undefined’ in firebug. I have tried to trace the error, but keep hitting a brick wall, hence the post. One of the areas with the error is in the divId block and the other is the #company in the form. I would be grateful if someone could check my code and point out my error. Thanks

// Function to add box

function addbox() {

    $("#boxform").dialog({
        autoOpen: false,
        resizable: true,
        modal: true,
        title: 'Submit a box intake request',
        width: 470,
        beforeclose: function (event, ui) {
            $("#addbox").html("");
            $("#divId").html("");

        }

    });

    $('#boxsubmit').click(function () {

        var company = $('.company').val();
        var box = $('.box').val();
        var service = $('#service').val();
        var authorised = $('.authorised').val();
        var address = $('.address').val();
        var data = 'company=' + company + '&box=' + box + '&authorised=' + authorised + '&service=' + service + '&address=' + address;
        $.ajax({
            type: "POST",
            url: "boxesadd.php",
            data: data,
            success: function (data) {
                $("#boxform").get(0).reset();
                $('#addbox').html(data);
                //$("#form").dialog('close');
                $("#flex1").flexReload();

            }
        });
        return false;

    });

    $("#boxform").dialog('open');

}

html

<script language="javascript" type="text/javascript">
      $(function() {
    $("#company").live('change', function() { if ($(this).val()!="")
    $.get("../../getOptions.php?customer=" + $(this).val(), function(data) {
    $("#divId").html(data); }); }); 
      });
</script

<form id="boxform" method="post" class="webform" name="boxform" />

        <label for="company">Select a Company:</label>
        <select name="company" id="company" />
          <option SELECTED VALUE="">Select a Company</option>
          <?php
           do {  
           ?>
          <option value="<?php echo $row_Recordsetcust['customer']?>"><?php echo $row_Recordsetcust['customer']?></option>
          <?php

          } 
          while ($row_Recordsetcust = mysql_fetch_assoc($Recordsetcust));
          $rows = mysql_num_rows($Recordsetcust);
          if($rows > 0)

         {
          mysql_data_seek($Recordsetcust, 0);
          $row_Recordsetcust = mysql_fetch_assoc($Recordsetcust);
                    }

          ?>
          </select>

          <!--- displays the address from the change function -->
          <div id="divId"></div>
  • 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-23T20:58:49+00:00Added an answer on May 23, 2026 at 8:58 pm

    Try changing

    <form id="boxform" method="post" class="webform" name="boxform" />
    

    to

    <form id="boxform" method="post" class="webform" name="boxform"> 
    

    and

    <select name="company" id="company" />
    

    to

    <select name="company" id="company">
    

    and

    var company = $('.company').val();
    

    to

    var company = $('#company').val();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

change() function works and detects changes on form elements, but is there a way
About to create a form using Zend Form, all the form elements should have
I found this code from here: http://www.cssportal.com/form-elements/text-box.htm But the problem is you can still
This week I have figured out how to modify form elements in the location
I have a form where a user can toggle receiving funds either via check
I have a form with many form elements that are not allways populated with
I have iframe with with form elements such as input, select textarea etc. I
I have a few hidden form elements like so: <input type=hidden name=numberOfAdults /> I
I have a table of form elements where each row represents a record and
I have a table that contains form elements that I need to replace if

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.