pcvodak
01-10-2008, 11:50 AM
I'm trying to use data from an XML file to fill in several values of an HTML form that when the submit button is click will add an item to a shopping cart.
Here is a snippet of the form code:
<form target="cart" action="url goes here" method="post">
<input type="image" src="button.gif" border="0" name="submit" alt="submit">
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="BOGUS COMPANY">
<input type="hidden" name="item_name" value=<%ITEM NAME%>>
<input type="hidden" name="item_number" value=<%ITEM NUMBER%>>
<input type="hidden" name="amount" value=<%PRICE%>>
</form>
Here is the XML file info:
<PRODUCTS>
<ITEMS>
<ITEM NAME>Toy Car</ITEM NAME>
<ITEM NUMBER>TC101</ITEM NUMBER>
<PRICE>15.00</PRICE>
</ITEMS>
</PRODUCTS>
I have several items in the XML file and several items will be displayed on the HTML page with each item having it's own submit/add to cart button.
I can't seem to get this to work. Any help would be appreciated.
Here is a snippet of the form code:
<form target="cart" action="url goes here" method="post">
<input type="image" src="button.gif" border="0" name="submit" alt="submit">
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="BOGUS COMPANY">
<input type="hidden" name="item_name" value=<%ITEM NAME%>>
<input type="hidden" name="item_number" value=<%ITEM NUMBER%>>
<input type="hidden" name="amount" value=<%PRICE%>>
</form>
Here is the XML file info:
<PRODUCTS>
<ITEMS>
<ITEM NAME>Toy Car</ITEM NAME>
<ITEM NUMBER>TC101</ITEM NUMBER>
<PRICE>15.00</PRICE>
</ITEMS>
</PRODUCTS>
I have several items in the XML file and several items will be displayed on the HTML page with each item having it's own submit/add to cart button.
I can't seem to get this to work. Any help would be appreciated.