Page 1 of 2 12 Last
  • Jump to page:
    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    9
    Rep Power
    0

    Form issue (unable to pass select box value from 1 form to another)


    Hello everyone,

    I am 18 and I am developing a website. I have an issue with forms.

    In my webpage i have 2 forms. 1 form has 3 select dropdown boxes and the other one is the main form which parses to a php script.

    I would want the values of my 1st form dropdown select boxes to be passed into a hidden input field in the second form so that I can parse those to mysql database.

    I am having difficulties passing the value of my 3 dropdown list in 1st form to the main form. Please help and thanks in advance.


    below are my 2 forms

    3 dropdown select form--->

    <form action="" method="get" name="tripleplay"><table width="65%" border="1">
    <tr>
    <td width="25%" align="right">Category&nbsp; </td>
    <td width="75%"><select name='List1' id="catg1" onchange="fillSelect(this.value,this.form['List2'])">
    <option selected="selected">Make a selection</option>
    </select></td>
    </tr>
    <tr>
    <td align="right">First-Subcategory&nbsp; </td>
    <td><select name='List2' id="catg2" onchange="fillSelect(this.value,this.form['List3'])">
    <option selected="selected">Make a selection</option>
    </select></td>
    </tr>
    <tr>
    <td align="right">Second-Subcategory&nbsp; </td>
    <td><select name='List3' id="catg3" onchange="getValue(this.value, this.form['List2'].value,
    this.form['List1'].value)">
    <option selected="selected" >Make a selection</option>
    </select></td>
    </tr>
    </table></form>
    ++++++++++++++++++++++++++++++++++++++++


    Main Form--->

    <form action="inventory_list.php" method="post" enctype="multipart/form-data" name="myForm"><table width="65%" border="1">
    <tr>
    <td align="right" width="25%">Product Name&nbsp;</td>
    <td width="75%"><input name="product_name" type="text" id="product_name"/></td>
    </tr>
    <tr>
    <td align="right">Price&nbsp; </td>
    <td> $ <input name="price" type="text" id="price"/></td>
    </tr>
    <tr>
    <td align="right">Details &nbsp;</td>
    <td><textarea name="details" cols="55" rows="10">&nbsp;</textarea></td>
    </tr>
    <tr>
    <td align="right">Upload Product Image&nbsp; </td>
    <td>&nbsp;<input name="imagefile" type="file" /></td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td><input name="submit" type="submit" value="submit" />&nbsp; <input name="reset" type="reset" value="reset" /> <input name="category" type="hidden" value="cat1"/>
    <input name="first_subcategory" type="hidden" value="cat2" />
    <input name="second_subcategory" type="hidden" value="cat3"/>

    </td>
    </tr>
    </table></form>

    Again Thanks in advance
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    20
    Rep Power
    0
    Originally Posted by laxi
    <td width="75%"><select name='List1' id="catg1"
    <td><select name='List2' id="catg2"
    <td><select name='List3' id="catg3" onchange="getValue(this.value, this.form['List2'].value,

    ++++++++++++++++++++++++++++++++++++++++

    <input name="category" type="hidden" value="cat1"/>
    <input name="first_subcategory" type="hidden" value="cat2" />
    <input name="second_subcategory" type="hidden" value="cat3"/>
    Small errors are annoying I know

    but try making the values the same in both locations
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    9
    Rep Power
    0
    I did change that but still no go...


    What i need is to get values of the 3 dropdowns from the first form to be passed to the second form.

    The first form has no submit button. Both the forms are on the same page, and only the second form has the submit button which used the values of the 1st form dropdown to then parse to a php script.

    I think we need some javascript to collect values from 1st select box and pass them to second.

    Not sure how to proceed..
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    20
    Rep Power
    0
    try...
    Code:
    //change listX option id to "catXval"
    
    <script type="text/javascript">
    var catg1 = document.getElementById("cat1val").value;
    var catg2 = document.getElementById("cat2val").value;
    var catg3 = document.getElementById("cat3val").value;
    
    /*then you need to set them into the field, I will try help later, busy @ work atm. :/ */
    
    </script>
    
    //set to fields:
    
    <input name="category" type="hidden" value='<script type="text/javascript>return cat1val;</script>'>
    
    <input name="first_subcategory" type="hidden" value='<script type="text/javascript>return cat2val;</script>'>
    
    <input name="second_subcategory" type="hidden" value='<script type="text/javascript>return cat3val;</script>'>
    ps. you don't really need to close html tags unless necessary, ( />) table row / heading / data is essential... but for things like: <input type="button" name="btn"> you dont need to.
    Note: i have used single quotes in the input field for the catg's so that it doesn't mix up with the other double quotes
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    20
    Rep Power
    0

    Talking


    Still no luck?
    I will have a look tomorrow, I'm heading out this evening, so tomorrow I will have a decent look, I only gave you about 5 mins of my time earlier... I hope you find the solution... Good luck!
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    9
    Rep Power
    0
    Originally Posted by dev.josh
    Still no luck?
    I will have a look tomorrow, I'm heading out this evening, so tomorrow I will have a decent look, I only gave you about 5 mins of my time earlier... I hope you find the solution... Good luck!
    Hi Josh,

    I followed your steps, but when i tried submitting the form I got only part of the information submitted was captured. Also the form dissappeared on submit.

    I then modified my code again and same results again.


    I think the javascript code that I used for my 3 dependable select boxes for categories in the first form also needs a relook .

    ========================================

    <script type="text/javascript">


    var categories = [];
    categories["startList"] = ["CLOTHING","ELECTRONICS","AUTOMOBILES"];
    categories["CLOTHING"] = ["MEN","WOMEN","KIDS", "FEATURED STORES CLOTHING","OFFERS CLOTHING"];
    categories["ELECTRONICS"] = ["CAR/AUTO ELECTRONICS & GPS","CAMERA AND PHOTO","CELL PHONES AND ACCESSORIES","MP3 PLAYERS AND ACCESSORIES","TV,HOME THEATRE,AUDIO/VIDEO","MUSICAL INSTRUMENTS AND ACCESSORIES","VIDEO GAMES"];
    categories["AUTOMOBILES"] = ["CAR","MOTORCYCLE"];
    categories["MEN"] = ["T-shirts","Casual & Party Wear Shirts","Formal Shirts","Jeans","Cargos, Shorts & 3/4ths","Trousers","Inner & Sleep Wear","Rainwear","Sports Wear","Accessories & Combo Sets","Suits & Blazers","BRANDS MEN"];
    categories["WOMEN"] = ["Dresses & Skirts","Ethnic Wear","Shirts, Tops & Tunics","Polos & T-shirts","Jeans & Shorts", "Leggings & Jeggings","Trousers & Capris","Lingerie & Sleepwear","Accessories","BRANDS WOMEN"];
    categories["KIDS"] = ["BOYS","GIRLS","INFANTS"];
    categories["FEATURED STORES"] = ["For Men", "For Women", "For Kids"];
    categories["OFFERS"] = ["Featured Deals", "SALE"];

    categories["CAR/AUTO ELECTRONICS & GPS"] = ["Car Audio","Car Stereo", "Car Speakers", "Car Amplifiers","Car Subwoofers","Car Video", "Satellite Radio", "CB Radio","OTHER Car Audio & Video ","Alarm Systems", "Key-less entry", "Remote Starters", "Vehicle Back-Up Cameras","Steering Wheel Locking ","Radar Detectors", "OTHER Car Safety & Security", "Vehicle GPS" ,"GPS Mapping Software", "GPS Trackers", "GPS Systems Accessories", "Sport & Handheld GPS", "Boating GPS","OTHER GPS & Navigation",];
    categories["CAMERA AND PHOTO"] = ["Digital SLR","Point & Shoot","Advanced Point & Shoot", "Camcorder", "Mirrorless ","Brands", "SLR ACCESSORIES", "Lenses by brands", "Lens Cleaners","Lens Caps ","Filters", "Flashes", "Memory Cards" , "Tripods", "Camera Bags", "Binoculars & Optics", "Digital Photoframes", "FEATURED STORES","OFFERS"];
    categories["CELL PHONES AND ACCESSORIES"] = ["Brand cell phones","Samsung","Micromax", "Nokia", "Sony ","HTC", "Apple", "BlackBerry", "FEATURED STORES CELL PHONES AND ACCESSORIES","OFFERS CELL PHONES AND ACCESSORIES ","SERVICES"];
    categories["MP3 PLAYERS AND ACCESSORIES"] = ["Under 1GB","1 to 4 GB","5 to 24 GB", "25 to 60 GB","61 to 120 GB", "Over 120 GB","ipod", "MP3 PLAYERS","SPEAKER SYSTEMS","MP3 ACCESSORIES","HEADPHONES", "CASES"];
    categories["TV,HOME THEATRE,AUDIO/VIDEO"] = ["Home Theater Systems","Compact & Portable Audio","Speakers", "Home Audio Accessories","Headphones", "HDTVs","Blu-ray Players and Projectors", "OTHER HOME THEATER EQPMTS "];
    categories["MUSICAL INSTRUMENTS AND ACCESSORIES"] = ["Guitars","Bass Guitars","Drums & Percussion", "Keyboards", "Band & Orchestra","Folk & World Instruments","Instrument Accessories", "Studio Recording Equipment ","Top Deals"];
    categories["VIDEO GAMES"] = ["PlayStation 4","PlayStation 3", "Xbox One", "Xbox 360","Sony PSP","Mac","Sony PSP", "Digital Games", "Best-Selling Video Games","OTHER GAMES AND ACCESSORIES", ];



    categories["CAR"] = ["MAKE","NEW","USED", "OTHERS"];

    categories["MOTORCYCLE"] = ["Ducati","BMW", "Shop by Type"]

    var nLists = 3; // number of select lists in the set

    function fillSelect(currCat,currList){
    var step = Number(currList.name.replace(/\D/g,""));
    for (i=step; i<nLists+1; i++) {
    document.forms['tripleplay']['List'+i].length = 1;
    document.forms['tripleplay']['List'+i].selectedIndex = 0;
    }
    var nCat = categories[currCat];
    for (each in nCat) {
    var nOption = document.createElement('option');
    var nData = document.createTextNode(nCat[each]);
    nOption.setAttribute('value',nCat[each]);
    nOption.appendChild(nData);
    currList.appendChild(nOption);
    }
    }



    function init() {
    fillSelect('startList',document.forms['tripleplay']['List1'])
    }

    navigator.appName == "Microsoft Internet Explorer" ? attachEvent('onload', init, false) : addEventListener('load', init, false);

    </script>
    <script type="text/javascript">
    var catg1 = document.getElementById("List1").value;
    var catg2 = document.getElementById("List2").value;
    var catg3 = document.getElementById("List3").value;



    </script>

    <body>
    <div align="center" id="mainWrapper">
    <?php include_once("../template_header.php");?>
    <div id="pageContent"><br />
    <div align="right" style="margin-right:32px;"><a href="inventory_list.php#inventoryForm">+ Add New Inventory Item</a></div>
    <div align="left" style="margin-left:24px;">
    <h2>Inventory list</h2>
    <?php echo $product_list; ?>
    </div>
    <hr />
    <a name="inventoryForm" id="inventoryForm"></a>
    <h3>
    &darr; Add New Inventory Item Form &darr;
    </h3>
    <div id="dropdown">
    <form action="" name="tripleplay">
    <table width="835" border="0">
    <tr>
    <td align="right" width="205">Category : </td>
    <td width="614"><select name='List1' onchange="fillSelect(this.value,this.form['List2'])">
    <option selected>Make a selection</option>
    </select></td>
    </tr>
    <tr>
    <td align="right" >First Subcategory : </td>
    <td><select name='List2' onchange="fillSelect(this.value,this.form['List3'])">
    <option selected>Make a selection</option>
    </select></td>
    </tr>
    <tr>
    <td align="right">Second Subcategory : </td>
    <td><select name='List3' onchange="getValue(this.value, this.form['List2'].value,
    this.form['List1'].value)">
    <option selected >Make a selection</option>
    </select></td>
    </tr>
    </table>
    </form>
    </div>
    <form action="inventory_list.php" enctype="multipart/form-data" name="myForm" id="myform" method="post">
    <table width="835" border="0">
    <tr>
    <td width="205" align="right">Product Name : </td>
    <td width="620" ><label>
    <input name="product_name" type="text" id="product_name" size="64" />
    </label></td>
    </tr>
    <tr>
    <td align="right">Product Price : </td>
    <td><label>
    $
    <input name="price" type="text" id="price" size="12" />
    </label></td>
    </tr>

    <tr>
    <td align="right">Product Details : </td>
    <td><label>
    <textarea name="details" id="details" cols="64" rows="5"></textarea>
    </label></td>
    </tr>
    <tr>
    <td align="right">Product Image : </td>
    <td><label>
    <input type="file" name="fileField" id="fileField" />
    </label></td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td>
    <input type="submit" name="button" id="button" value="Submit" />
    &nbsp;
    <input type="reset" name="reset" id="reset" value="reset" /><input name="category" type="hidden" value='<script type="text/javascript>return catg1;</script>'>

    <input name="first_subcategory" type="hidden" value='<script type="text/javascript>return catg2;</script>'>

    <input name="second_subcategory" type="hidden" value='<script type="text/javascript>return catg3;</script>'>

    </td>
    </tr>
    </table>
    </form>
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    20
    Rep Power
    0
    hey, sorry I kinda kept away from computers over the weekend... I will have a look in approx 4 hrs... (6pm GMT+0)


    Are you still experiancing problems?


    oh and btw:

    If you read the forum rules it does state you should use the code tags to hold your code.
    So if you have some code:

    <this><is><some>Example<code>

    it should be displayed like this:

    Code:
    <this><is><some>Example<code>


    use these brackets (Remove the 'hash' symbols '#'): [#code]<paste/write your code here>[#/code]

    you can also use others like:
    highlight=javascript<<>>/highlight
    highlight=html4strict<<>>/highlight
    they will give different syntax colouring.
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    9
    Rep Power
    0
    Originally Posted by dev.josh
    hey, sorry I kinda kept away from computers over the weekend... I will have a look in approx 4 hrs... (6pm GMT+0)


    Are you still experiancing problems?


    oh and btw:

    If you read the forum rules it does state you should use the code tags to hold your code.
    So if you have some code:

    <this><is><some>Example<code>

    it should be displayed like this:

    Code:
    <this><is><some>Example<code>


    use these brackets (Remove the 'hash' symbols '#'): [#code]<paste/write your code here>[#/code]

    you can also use others like:
    highlight=javascript<<>>/highlight
    highlight=html4strict<<>>/highlight
    they will give different syntax colouring.
    Hi Josh,

    Thank you for your reply. I am still not able to figure things out properly.

    Now what I was considering here is to get the dropdown items to show up appropriately without a page refresh so that i could parse these inputs to a php script and have all these stored in mysql db. can u give me some guidance in getting this accomplished.

    Not sure if I need to approach this in a whole diffrent way..
  16. #9
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    20
    Rep Power
    0
    Originally Posted by laxi
    Hi Josh,

    Thank you for your reply. I am still not able to figure things out properly.

    ...
    Give me an hour or so and I will have a look... busy at work atm
  18. #10
  19. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    9
    Rep Power
    0
    Thank you Josh for your time


    Originally Posted by dev.josh
    Give me an hour or so and I will have a look... busy at work atm
  20. #11
  21. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    20
    Rep Power
    0
    ok, i'm back from work.

    I'll have a good look and reply when done
  22. #12
  23. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    20
    Rep Power
    0
    Originally Posted by laxi
    Thank you Josh for your time
    Can you .zip the files, upload them and send a link?
    cheers
  24. #13
  25. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    9
    Rep Power
    0
    Originally Posted by dev.josh
    Can you .zip the files, upload them and send a link?
    cheers
    Hi Josh,

    Please find link here:https://docs.google.com/file/d/0BzuXaE1_37DhajdVSDlHNHYxMGs/edit?usp=sharing
  26. #14
  27. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    20
    Rep Power
    0
    Originally Posted by laxi
    Hi Josh,

    Please find link here:https://docs.google.com/file/d/0BzuXaE1_37DhajdVSDlHNHYxMGs/edit?usp=sharing
    I sent a request...


    Oh and btw I looked at your code...
    I dont know why you made it in that way?
    I would have used a script that fills the dropdown list with an array.
    & I havent seen an array declared like that before?
    usually I would have thought of it being declared like so:

    var pets = new Array();
    pets[0]="cat";
    pets[1]="dog";
    pets[2]="mouse";

    (This method is easier to locate and modify, except I would use Netbeans section hider... So it condenses the look of you code when you are developing... p.s. "yes section hider is most likely the wrong termanology... if you can provide me with the correct term please feel free to do so.")
    or

    var pets = new Array("cat","dog","mouse");
  28. #15
  29. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    20
    Rep Power
    0
    I have had a play around with it... to be honest mate.. This is the first time I have used javascripts and list items :P

    but here's whats left with what I was playing with... I am at work... so I should crack on with other things...

    NOTE: I have commented out some of your code when I was testing... just to get the list values working first.


    javascript Code:
    <!DOCTYPE html>
    <html>
        <head>
            <title>Testing...</title>
            <script type="text/javascript" src="jquery.js"></script>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <script type="text/javascript">
     
    /*
    var categories = [];
    categories["startList"] = ["CLOTHING","ELECTRONICS","AUTOMOBILES"];
    categories["CLOTHING"] = ["MEN","WOMEN","KIDS", "FEATURED STORES CLOTHING","OFFERS CLOTHING"];
    categories["ELECTRONICS"] = ["CAR/AUTO ELECTRONICS & GPS","CAMERA AND PHOTO","CELL PHONES AND ACCESSORIES","MP3 PLAYERS AND ACCESSORIES","TV,HOME THEATRE,AUDIO/VIDEO","MUSICAL INSTRUMENTS AND ACCESSORIES","VIDEO GAMES"];
    categories["AUTOMOBILES"] = ["CAR","MOTORCYCLE"];
    categories["MEN"] = ["T-shirts","Casual & Party Wear Shirts","Formal Shirts","Jeans","Cargos, Shorts & 3/4ths","Trousers","Inner & Sleep Wear","Rainwear","Sports Wear","Accessories & Combo Sets","Suits & Blazers","BRANDS MEN"];
    categories["WOMEN"] = ["Dresses & Skirts","Ethnic Wear","Shirts, Tops & Tunics","Polos & T-shirts","Jeans & Shorts", "Leggings & Jeggings","Trousers & Capris","Lingerie & Sleepwear","Accessories","BRANDS WOMEN"];
    categories["KIDS"] = ["BOYS","GIRLS","INFANTS"];
    categories["FEATURED STORES"] = ["For Men", "For Women", "For Kids"];
    categories["OFFERS"] = ["Featured Deals", "SALE"];
     
    categories["CAR/AUTO ELECTRONICS & GPS"] = ["Car Audio","Car Stereo", "Car Speakers", "Car Amplifiers","Car Subwoofers","Car Video", "Satellite Radio", "CB Radio","OTHER Car Audio & Video ","Alarm Systems", "Key-less entry", "Remote Starters", "Vehicle Back-Up Cameras","Steering Wheel Locking ","Radar Detectors", "OTHER Car Safety & Security", "Vehicle GPS" ,"GPS Mapping Software", "GPS Trackers", "GPS Systems Accessories", "Sport & Handheld GPS", "Boating GPS","OTHER GPS & Navigation",];
    categories["CAMERA AND PHOTO"] = ["Digital SLR","Point & Shoot","Advanced Point & Shoot", "Camcorder", "Mirrorless ","Brands", "SLR ACCESSORIES", "Lenses by brands", "Lens Cleaners","Lens Caps ","Filters", "Flashes", "Memory Cards" , "Tripods", "Camera Bags", "Binoculars & Optics", "Digital Photoframes", "FEATURED STORES","OFFERS"];
    categories["CELL PHONES AND ACCESSORIES"] = ["Brand cell phones","Samsung","Micromax", "Nokia", "Sony ","HTC", "Apple", "BlackBerry", "FEATURED STORES CELL PHONES AND ACCESSORIES","OFFERS CELL PHONES AND ACCESSORIES ","SERVICES"];
    categories["MP3 PLAYERS AND ACCESSORIES"] = ["Under 1GB","1 to 4 GB","5 to 24 GB", "25 to 60 GB","61 to 120 GB", "Over 120 GB","ipod", "MP3 PLAYERS","SPEAKER SYSTEMS","MP3 ACCESSORIES","HEADPHONES", "CASES"];
    categories["TV,HOME THEATRE,AUDIO/VIDEO"] = ["Home Theater Systems","Compact & Portable Audio","Speakers", "Home Audio Accessories","Headphones", "HDTVs","Blu-ray Players and Projectors", "OTHER HOME THEATER EQPMTS "];
    categories["MUSICAL INSTRUMENTS AND ACCESSORIES"] = ["Guitars","Bass Guitars","Drums & Percussion", "Keyboards", "Band & Orchestra","Folk & World Instruments","Instrument Accessories", "Studio Recording Equipment ","Top Deals"];
    categories["VIDEO GAMES"] = ["PlayStation 4","PlayStation 3", "Xbox One", "Xbox 360","Sony PSP","Mac","Sony PSP", "Digital Games", "Best-Selling Video Games","OTHER GAMES AND ACCESSORIES", ];
     
     
     
    categories["CAR"] = ["MAKE","NEW","USED", "OTHERS"];
     
    categories["MOTORCYCLE"] = ["Ducati","BMW", "Shop by Type"]
     
    var nLists = 3; // number of select lists in the set
     
    function fillSelect(currCat,currList){
    var step = Number(currList.name.replace(/\D/g,""));
    for (i=step; i<nLists+1; i++) {
    document.forms['tripleplay']['List'+i].length = 1;
    document.forms['tripleplay']['List'+i].selectedIndex = 0;
    }
    var nCat = categories[currCat];
    for (each in nCat) {
    var nOption = document.createElement('option');
    var nData = document.createTextNode(nCat[each]);
    nOption.setAttribute('value',nCat[each]);
    nOption.appendChild(nData);
    currList.appendChild(nOption);
    }
    }
     
     
     
    function init() {
    fillSelect('startList',document.forms['tripleplay']['List1'])
    }
     
    navigator.appName == "Microsoft Internet Explorer" ? attachEvent('onload', init, false) : addEventListener('load', init, false);
    */
    </script>
    <script type="text/javascript">
    /*
     * var catg1 = document.getElementById("List1").value;
     * var catg2 = document.getElementById("List2").value;
     * var catg3 = document.getElementById("List3").value;
    */
     
     
    </script>
        </head>
    <body>
    <div align="center" id="mainWrapper">
    <?php include_once("../template_header.php");?>
    <div id="pageContent"><br />
    <div align="right" style="margin-right:32px;"><a href="inventory_list.php#inventoryForm">+ Add New Inventory Item</a></div>
    <div align="left" style="margin-left:24px;">
    <h2>Inventory list</h2>
    <?php echo $product_list; ?>
    </div>
    <hr />
    <a name="inventoryForm" id="inventoryForm"></a>
    <h3>
    &darr; Add New Inventory Item Form &darr;
    </h3>
    <div id="dropdown">
    <form action="" name="tripleplay">
    <table width="835" border="0">
    <tr>
    <td align="right" width="205">Category : </td>
    <td width="614"><select name='List1' onchange="fillSelect(this.value,this.form['List2'])">
    <option selected>Make a selection</option>
    </select></td>
    </tr>
    <tr>
    <td align="right" >First Subcategory : </td>
    <td><select name='List2' onchange="fillSelect(this.value,this.form['List3'])">
    <option selected>Make a selection</option>
    </select></td>
    </tr>
    <tr>
    <td align="right">Second Subcategory : </td>
    <td><select name='List3' onchange="getValue(this.value, this.form['List2'].value,
    this.form['List1'].value)">
    <option selected >Make a selection</option>
    </select></td>
    </tr>
    </table>
    </form>
    </div>
    <form action="inventory_list.php" enctype="multipart/form-data" name="myForm" id="myform" method="post">
    <table width="835" border="0">
    <tr>
    <td width="205" align="right">Product Name : </td>
    <td width="620" ><label>
    <input name="product_name" type="text" id="product_name" size="64" />
    </label></td>
    </tr>
    <tr>
    <td align="right">Product Price : </td>
    <td><label>
    $
    <input name="price" type="text" id="price" size="12" />
    </label></td>
    </tr>
     
    <tr>
    <td align="right">Product Details : </td>
    <td><label>
    <textarea name="details" id="details" cols="64" rows="5"></textarea>
    </label></td>
    </tr>
    <tr>
    <td align="right">Product Image : </td>
    <td><label>
    <input type="file" name="fileField" id="fileField" />
    </label></td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td>
    <input type="submit" name="button" id="button" value="Submit" />
    &nbsp;
    <input type="reset" name="reset" id="reset" value="reset" /><input name="category" type="hidden" value='<script type="text/javascript>return catg1;</script>'>
     
    <input name="first_subcategory" type="hidden" value='<script type="text/javascript>return catg2;</script>'>
     
    <input name="second_subcategory" type="hidden" value='<script type="text/javascript>return catg3;</script>'>
     
    </td>
    </tr>
    </table>
    </form>
    <FORM name="drop_list" action="NextPage.jsp" method="POST" >  
     
    <SELECT NAME="Month_list">  
    <option value="" >Month list</option>  
    </SELECT>  
     
    </FORM>  
    <script  language=javascript type="text/javascript">  
     
    var categoryA1 = new Array("CLOTHING","ELECTRONICS","AUTOMOBILES");
    var categoryA2 = new Array("MEN","WOMEN","KIDS", "FEATURED STORES CLOTHING","OFFERS CLOTHING");
     
    var selObj1 = document.forms["tripleplay"].elements["List1"];
    var selObj2 = document.forms["tripleplay"].elements["List2"];
    var selObj3 = document.forms["tripleplay"].elements["List3"];
     
     
    for (var i=0; i < categoryA1.length;++i)  
    {  
     
    addOption(selObj1, categoryA1[i], categoryA1[i]);
    }
    for (var i=0; i < categoryA2.length;++i)  
    {
    addOption(selObj2, categoryA2[i], categoryA2[i]);
    }
    function addOption(selectbox,text,value )  
    {  
     
    var optn = document.createElement("OPTION");  
    optn.text = text;  
    optn.value = value;  
    selectbox.options.add(optn);  
    }  
     
    </script>
    </body>
    </html>
Page 1 of 2 12 Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo