Jump to content

harryuk

Members
  • Posts

    19
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Male
  • Location
    London, UK

harryuk's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. ah that makes sense thank you every much for your time1
  2. ok would you mind giving an example???
  3. ok viop thank you i will have a look.
  4. Yes exactly. Under the sub-category section all the option tags have no values until an item is selected on the category section. Usually you would have values already in the option tag so you can add your $_POST function in order to send all form info to another page. But in this instance i do not have any values to be able to add a $_POST function?!?!
  5. Yes sorry i do have a submit button i didnt copy all of my coding. How would you auto update???? The java script updates it when i have ftp'ed it but i need to be able to show what sub-category item i selected when i have submitted.
  6. Try putting a # or a . before the CSS name.
  7. ok Thanks. Updating to mysql i not a priority it is more important to be able to echo the form info out in a different page.
  8. One problem.....Not familar with AJAX
  9. Yes i would need it to update mysql as well as echoing out in to a table.
  10. Hi, I would like to use the $_POST function for the sub-category section of the form. The problem i am having is how i can do this as i am using javascript to automatically update the sub-category section when a item is selected in the category section. So where and how would i put the $_POST function so i can echo the form info including what sub-category item i selected out on my index.php page. I hope that makes sense. Please help Thank you team = new Array( new Array( new Array("Toesavers", 39482304), new Array("Dr. Martens Industrial", 34802389), new Array("Himalayan", 39823498), new Array("Caterpillar", 87587343), new Array("Timberland", 68798735) ), new Array( new Array("Hand Protection", 23840238), new Array("Eye & Face Protection", 92390484), new Array("WeatherWear", 29048203), new Array("Head Protection", 94098230), new Array("Hearing Protection", 39234923), new Array("Respiratory Protection", 29345423) ), ); function fillSelectFromArray(selectCtrl, itemArray, goodPrompt, badPrompt, defaultItem) { var i, j; var prompt; // empty existing items for (i = selectCtrl.options.length; i >= 0; i--) { selectCtrl.options[i] = null; } prompt = (itemArray != null) ? goodPrompt : badPrompt; if (prompt == null) { j = 0; } else { selectCtrl.options[0] = new Option(prompt); j = 1; } if (itemArray != null) { // add new items for (i = 0; i < itemArray.length; i++) { selectCtrl.options[j] = new Option(itemArray[i][0]); if (itemArray[i][1] != null) { selectCtrl.options[j].value = itemArray[i][1]; } j++; } selectCtrl.options[0].selected = true; } } <form> <select name="Make" onchange="fillSelectFromArray(this.form.Team, ((this.selectedIndex == -1) ? null : team[this.selectedIndex-1]));"> <option value="-1" selected="selected">Select Category</option> <option value="1">Footwear</option> <option value="2">PPE</option> <option value="3">Ladders</option> </select></label> <label> Sub-Category <select name="Team"> <option></option> <option></option> <option></option> <option></option> <option></option> <option></option> </select></label> </form>
  11. You have to link every page you want to use the CSS. Are you linking the two pages the right way round?? And last Question are you using dreamweaver? if not what software are you using??
  12. Hello follow PHP'ers I have a form stored in my admin directory and a public temple named Products. I have a link on my header to access it!!! I am using abit of Java script so when a product is selected (admin side) from a drop down menu named category it updates the sub-category drop down menu that is all working fine. What i cant work out is when a product is selected from the sub-category and the form is submited how to put all the stored data on to the public template products and how to what ever is selected from the sub-category echoes out under a header on the public template named what ever was selected. Example $product_glasses = ""; $sql = mysql_query("SELECT * FROM products ORDER BY date_added DESC"); $productCount = mysql_num_rows($sql); if ($productCount > 0) { while($row = mysql_fetch_array($sql)){ $id = $row["id"]; $product_name = $row["product_name"]; $price = $row["price"]; $date_added = strftime("%b %d, %Y", strtotime($row["date_added"])); $product_list .= "Product ID: $id - <strong>$product_name</strong> - $$price - $category - $subcategory • <a href='inventory_list.php?deleteid=$id'>delete</a><br />"; } } else { $product_glasses = "You have no products listed in your store yet"; } ?> <form action="inventory_list.php" enctype="multipart/form-data" name="myForm" id="myform" method="post"> <table width="90%" border="0" cellspacing="0" cellpadding="6"> <tr> <td width="20%" align="right">Product Name</td> <td width="80%"><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">Category</td> <td><label> <select name="category" id="category"> <option value="Clothing">Clothing</option> <option value="accessories">accessories</option> </select> </label></td> </tr> <tr> <td align="right">Subcategory</td> <td><select name="subcategory" id="subcategory"> <option value=""></option> <option value="watches">watches</option> <option value="glasses">glasses</option> <option value="Shirts">Shirts</option> </select></td> </tr> <tr> <td align="right">Product Details</td> <td><label> <input type="submit" name="button" id="button" value="Add This Item Now" /> </label></td> </tr> </table> </form> Then have that echoed out in the public template products like so. <body> Glasses <hr> <? echo '$product_glasses' ?> <br /> <br /> watches <hr> <? echo '$product_watches' ?> /////////How i would be able to echo this out ???? I know i have do perform some code under the sub-category section but i just dont know what?? PLEASE HELP Thanks
  13. thanks for the reply!! What if i wanted to echo them out on the same page but in different areas on the page So for example Evlis <hr> <? 'put admin form info here' ?> <br /> <br /> Coolio <hr> <? ' Or put admin form info here' ?>
  14. Hello, I am studing PHP & mysql, And have come up stuck on a particular area?? I am designing a admin page to be able to submit info on to a public template. <form action="inventory_list.php" enctype="multipart/form-data" name="myform" id="myform" method="post"> <table width="90%" border="0" cellspacing="0" cellpadding="6"> <tr> <td width="20%" align="right">Name</td> <td width="80%"><label> <input name="product_name" type="text" id="product_name" size="64" /> </label></td> </tr> <tr> <td height="39" align="right">Category</td> <td><label> <select name="Make"> <option value="-1" selected="selected">Select Category</option> <option value="1">Singers</option> </select></label> <label> Sub-Category <select name="Team"> <option>Steve Brooks</option> <option>Elvis</option> <option>Coolio</option> </select></label> </td></tr> <tr> <td align="right">Details</td> <td><label> <textarea name="details" id="details" cols="64" rows="5"></textarea> </label></td> </tr> <tr> <td align="right">Image</td> <td><label> <input type="file" name="fileField" id="fileField" /> </label></td> </tr> <tr> <td> </td> <td><label> <input type="submit" name="button" id="button" value="Add This Item Now" /> </label></td> </tr> </table> </form> <br /> <br /> </div> </div> </body> </html> Once selected a sub category i want it submitted to a individual page. for example if elvis is selected in sub category in the admin area i would like all the info from the form echoed out in a public template named elvis.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.