DIV refuse Form tag and

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

DIV refuse Form tag and

Antony Adopo
Hello ofbizers,
 I'm facing a weird problem

first, when I want add one item in the cart, I have this problem:


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_}</#if></@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>&nbsp;</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}]&nbsp;
              <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>&nbsp;
               <#if minimumQuantity?exists &&  minimumQuantity &gt; 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

Reply | Threaded
Open this post in threaded view
|

Re: DIV refuse Form tag and

Antony Adopo
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 <[hidden email]>
Hello ofbizers,
 I'm facing a weird problem

first, when I want add one item in the cart, I have this problem:


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_}</#if></@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>&nbsp;</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}]&nbsp;
              <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>&nbsp;
               <#if minimumQuantity?exists &&  minimumQuantity &gt; 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