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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:53:11+00:00 2026-05-27T12:53:11+00:00

I have a php page to capture sales orders. it has a dependant drop

  • 0

I have a php page to capture sales orders. it has a dependant drop down list that pulls mysql table information based on the selected value.

When the user enters an order qty, I want a few things to happen:

  • Firstly, the entered value should be written to a variable $line1qty. I have the entry:
    <? $line1qty=$_POST[line1qty]; ?> in my code however this is not working as I am not sure it is set when the javascript refreshes the page.

  • Secondly, the next table row should become visible, there will be a maximum of 72 table entries, I want all the rows without a selected value hidden by default.

Any assitance would be appreciated, I know i am just missing something simple but am still very new to PHP. Thanks again.

My code for the page is:

<style type="text/css">
<!--
@import url("style.css");
-->
</style>

<script language="JavaScript">

function autoSubmit()
{
    var formObject = document.forms['theForm'];
    formObject.submit();
}

</script>

<?php

$packcode = $category = $sellingunit = null; //declare vars

if(isset($_GET["packcode"]) && is_numeric($_GET["packcode"]))
{
    $packcode = $_GET["packcode"];
}

if(isset($_GET["category"]) && is_numeric($_GET["category"]))
{
    $category = $_GET["category"];
}

if(isset($_GET["sellingunit"]) && is_numeric($_GET["sellingunit"]))
{
    $sellingunit = $_GET["sellingunit"];
}

?>

<form name="theForm" method="get">

<? $line1qty=$_POST[line1qty]; ?>


Capture the sales data 
<table id="hor-minimalist-a">
    <tr>
        <th valign=bottom>
        Select a Pack Code
        </th>
        <th valign=bottom>
        Category
        </th>
        <th valign=bottom>
        Selling <br> Units
        </th>
        <th valign=bottom>
        <b>Grouping</b>
        </th>
        <th valign=bottom>
        <b>Full Pallet<br>QTY</b>
        </th>
        <th valign=bottom>
        <font color=red><b>Order QTY</b></font>
        </th>
        <th valign=bottom>
        <font color=green><b>Points</b></font>
        </th>

    </tr>
    <tr>
        <td>
    <select name="packcode" onChange="autoSubmit();">
        <option value="null"></option>
<option value="1046" <?php if($packcode == 1046) echo " selected"; ?>>1046 - Domestos Liq Lemon 20x750ml</option>
<option value="1174" <?php if($packcode == 1174) echo " selected"; ?>>1174 - Omo Wash Pwdr MultiActiv6x6x500g</option>
<option value="1175" <?php if($packcode == 1175) echo " selected"; ?>>1175 - Surf Wash Pwdr Reg 6x6x500g</option>
<option value="1182" <?php if($packcode == 1182) echo " selected"; ?>>1182 - Breeze Soap Amber 8x12x125g</option>


    </select>
        </td>
        <td width=75>
            <?php

    if($packcode != null && is_numeric($packcode))
    {

        //POPULATE category

        $sql = "SELECT packcode, sellingunits, category,casesperpallet,grouping,shrinksperpallet FROM skudata WHERE packcode = $packcode";
        $data = mysql_query($sql);

        while($row = mysql_fetch_array($data))
        {        
            echo $row[category];

        ?>
        </td>
        <td width=75>
        <? echo $row[sellingunits]; ?>
        </td>
        <td width=75>
        <? echo $row[grouping]; ?>
        </td>
        <td width=75>
        <? if($row[sellingunits]=="CS"){echo $row[casesperpallet];} else {echo $row[shrinksperpallet];} ?>
        </td>
        <td width=75>
        <? if($line1qty > 0){ ?> 
        <input type=text name=line1qty id=line1qty size=3 value=<? echo $line1qty; ?> style="   color: red;text-align: center" onChange="autoSubmit();>
        <? } else { ?> 
        <input type=text name=line1qty id=line1qty size=3 style="color: red;text-align: center"> 
        <? } ?>
        </td>
        <td width=75>
        <input type=text name=line1points id=line1points size=3 disabled>
        </td>

    </tr>

        <?
            }}
        ?>

Thanks again, Appreciate the assistance this forum provides.

Have a good day,
Ryan

  • 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-27T12:53:12+00:00Added an answer on May 27, 2026 at 12:53 pm

    In these lines :

    <form name="theForm" method="get">
    <? $line1qty=$_POST[line1qty]; ?>
    

    You use “$_POST” but your form method is $_GET, so use $_GET["line1qty"].

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

Sidebar

Related Questions

I have a php page that displays rows from a mysql db as a
I have a PHP page that has 1 textbox and when I press on
I have a PHP page that returns a piece of HTML to set the
I have a PHP page that I run every minute through a CRON job.
I have a PHP page that does a couple of different things depending on
I have a php page that takes in a bunch of url parameters and
I have a PHP page that queries a DB to populate a form for
I have a php page that produces an array of elements. For the sake
I have a PHP page that needs to make a call to a external
I have a page that has haschhange tabs so when I click on a

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.