You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Antony Adopo <sa...@gmail.com> on 2013/11/23 20:25:14 UTC
DIV refuse Form tag and
Hello ofbizers,
I'm facing a weird problem
first, when I want add one item in the cart, I have this problem:
[image: Images intégrées 1]
this is from configproductdetail.ftl
I try to check why this happen and I discover that my form tag is deleted
when rendering in the browser ."div" tag refuse form tag even it is inside
or outside form tag
this the code:
<form method="post" action="<@ofbizUrl>additem<#if
requestAttributes._CURRENT_VIEW_?exists>/${requestAttributes._CURRENT_VIEW_}</#...@ofbizUrl>"
name="addform" style='margin: 0;'>
<div class="qtycart">// (my div tag)
<#assign inStock = true>
<#-- Variant Selection -->
<#if product.isVirtual?exists && product.isVirtual?upper_case
== "Y">
<#if variantTree?exists && 0 < variantTree.size()>
<#list featureSet as currentType>
<div>
<select name="FT${currentType}" onchange="javascript:getList(
this.name, (this.selectedIndex-1), 1);">
<option>${featureTypes.get(currentType)}</option>
</select>
</div>
</#list>
<input type='hidden' name="product_id"
value='${product.productId}' />
<input type='hidden' name="add_product_id" value='NULL' />
<#else>
<input type='hidden' name="product_id"
value='${product.productId}' />
<input type='hidden' name="add_product_id" value='NULL' />
<div
class='tabletext'><b>${uiLabelMap.ProductItemOutOfStock}.</b></div>
<#assign inStock = false>
</#if>
<#else>
<div>
<input type='hidden' name="product_id"
value='${product.productId}' />
<input type='hidden' name="add_product_id"
value='${product.productId}' />
</div>
<#if productNotAvailable?exists>
<#assign isStoreInventoryRequired =
Static["org.ofbiz.product.store.ProductStoreWorker"].isStoreInventoryRequired(request,
product)>
<#if isStoreInventoryRequired>
<div
class='tabletext'><b>${uiLabelMap.ProductItemOutOfStock}.</b></div>
<#assign inStock = false>
<#else>
<div
class='tabletext'><b>${product.inventoryMessage?if_exists}</b></div>
</#if>
</#if>
</#if>
<#-- check to see if introductionDate hasn't passed yet -->
<#if product.introductionDate?exists &&
nowTimestamp.before(product.introductionDate)>
<p> </p>
<div class='tabletext' style='color:
red;'>${uiLabelMap.ProductProductNotYetMadeAvailable}.</div>
<#-- check to see if salesDiscontinuationDate has passed -->
<#elseif product.salesDiscontinuationDate?exists &&
nowTimestamp.after(product.salesDiscontinuationDate)>
<div class='tabletext' style='color:
red;'>${uiLabelMap.ProductProductNoLongerAvailable}.</div>
<#-- check to see if the product requires inventory check and has
inventory -->
<#else>
<#if inStock>
<#if product.requireAmount?default("N") == "Y">
<#assign hiddenStyle = "visible">
<#else>
<#assign hiddenStyle = "hidden">
</#if>
<#if !configwrapper.isCompleted()>
<div>[${uiLabelMap.EcommerceProductNotConfigured}]
<input type="text" size="5" name="quantity" value="0"
disabled="disabled" /></div>
<#else>
<p class="bold">${uiLabelMap.CommonQuantity}</p>
<input type="text" size="5" name="quantity" class="bar"
value="1" />
<a href="javascript:addItem()" class="addtocart
cufontxt">${uiLabelMap.OrderAddToCart}</a>
<#if minimumQuantity?exists && minimumQuantity > 0>
Minimum order quantity is ${minimumQuantity}.
</#if>
</#if>
</#if>
</#if>
<#if requestParameters.category_id?exists>
<input type='hidden' name='category_id'
value='${requestParameters.category_id}' />
</#if>
</div>// (end of my div tag)
</form>
if someone already faced this problem and how resolve it?
thanks
Re: DIV refuse Form tag and
Posted by Antony Adopo <sa...@gmail.com>.
I noticed again that, xhen I used MULTIFLEX theme, I have no problem but
the problem happen when I use my own theme. could someone help me?
2013/11/23 Antony Adopo <sa...@gmail.com>
> Hello ofbizers,
> I'm facing a weird problem
>
> first, when I want add one item in the cart, I have this problem:
>
> [image: Images intégrées 1]
> this is from configproductdetail.ftl
>
> I try to check why this happen and I discover that my form tag is deleted
> when rendering in the browser ."div" tag refuse form tag even it is inside
> or outside form tag
>
> this the code:
> <form method="post" action="<@ofbizUrl>additem<#if
> requestAttributes._CURRENT_VIEW_?exists>/${requestAttributes._CURRENT_VIEW_}</#...@ofbizUrl>"
> name="addform" style='margin: 0;'>
> <div class="qtycart">// (my div tag)
> <#assign inStock = true>
> <#-- Variant Selection -->
> <#if product.isVirtual?exists && product.isVirtual?upper_case
> == "Y">
> <#if variantTree?exists && 0 < variantTree.size()>
> <#list featureSet as currentType>
> <div>
> <select name="FT${currentType}" onchange="javascript:getList(
> this.name, (this.selectedIndex-1), 1);">
> <option>${featureTypes.get(currentType)}</option>
> </select>
> </div>
> </#list>
> <input type='hidden' name="product_id"
> value='${product.productId}' />
> <input type='hidden' name="add_product_id" value='NULL' />
> <#else>
> <input type='hidden' name="product_id"
> value='${product.productId}' />
> <input type='hidden' name="add_product_id" value='NULL' />
> <div
> class='tabletext'><b>${uiLabelMap.ProductItemOutOfStock}.</b></div>
> <#assign inStock = false>
> </#if>
> <#else>
> <div>
> <input type='hidden' name="product_id"
> value='${product.productId}' />
> <input type='hidden' name="add_product_id"
> value='${product.productId}' />
> </div>
> <#if productNotAvailable?exists>
> <#assign isStoreInventoryRequired =
> Static["org.ofbiz.product.store.ProductStoreWorker"].isStoreInventoryRequired(request,
> product)>
> <#if isStoreInventoryRequired>
> <div
> class='tabletext'><b>${uiLabelMap.ProductItemOutOfStock}.</b></div>
> <#assign inStock = false>
> <#else>
> <div
> class='tabletext'><b>${product.inventoryMessage?if_exists}</b></div>
> </#if>
> </#if>
> </#if>
>
> <#-- check to see if introductionDate hasn't passed yet -->
> <#if product.introductionDate?exists &&
> nowTimestamp.before(product.introductionDate)>
> <p> </p>
> <div class='tabletext' style='color:
> red;'>${uiLabelMap.ProductProductNotYetMadeAvailable}.</div>
> <#-- check to see if salesDiscontinuationDate has passed -->
> <#elseif product.salesDiscontinuationDate?exists &&
> nowTimestamp.after(product.salesDiscontinuationDate)>
> <div class='tabletext' style='color:
> red;'>${uiLabelMap.ProductProductNoLongerAvailable}.</div>
> <#-- check to see if the product requires inventory check and
> has inventory -->
> <#else>
> <#if inStock>
> <#if product.requireAmount?default("N") == "Y">
> <#assign hiddenStyle = "visible">
> <#else>
> <#assign hiddenStyle = "hidden">
> </#if>
> <#if !configwrapper.isCompleted()>
> <div>[${uiLabelMap.EcommerceProductNotConfigured}]
> <input type="text" size="5" name="quantity" value="0"
> disabled="disabled" /></div>
> <#else>
> <p class="bold">${uiLabelMap.CommonQuantity}</p>
> <input type="text" size="5" name="quantity" class="bar"
> value="1" />
> <a href="javascript:addItem()" class="addtocart
> cufontxt">${uiLabelMap.OrderAddToCart}</a>
> <#if minimumQuantity?exists && minimumQuantity > 0>
> Minimum order quantity is ${minimumQuantity}.
> </#if>
> </#if>
> </#if>
> </#if>
> <#if requestParameters.category_id?exists>
> <input type='hidden' name='category_id'
> value='${requestParameters.category_id}' />
> </#if>
> </div>// (end of my div tag)
> </form>
>
> if someone already faced this problem and how resolve it?
> thanks
>
>