Note that there are some explanatory texts on larger screens.

plurals
  1. POMagento server side form validation
    text
    copied!<p>is there any server side form validation in magento? i have created a from and using magentos form validation but its not gonna work if someone disable the javascipt and enters something that can be harmful. if there is no built in class for that. could someone please point me in a direction how to implement a server side form validation as a backup. here is my my code for the form</p> <pre><code>&lt;div style="border:0px solid red; margin:0px auto;"&gt; &lt;?php $_product = $this-&gt;getProduct(); ?&gt; &lt;form id="test" action="&lt;?php echo Mage::getUrl('pricenotify/pricenotify/db') ?&gt;" method="post"&gt; &lt;label for="price"&gt;Price *&lt;/label&gt; &lt;input type="text" id="price" name="price" value="" class="required-entry validate-number"/&gt;&lt;br /&gt; &lt;label for="email"&gt;Email Address *&lt;/label&gt; &lt;input type="text" id="email" name="email" value="" class="required-entry validate-email"/&gt; &lt;input type="hidden" id="id" name="id" value="&lt;?php echo $_product-&gt;getId() ?&gt;" /&gt; &lt;input type="hidden" id="propri" name="propri" value="&lt;?php echo $_product-&gt;getPrice() ?&gt;" /&gt; &lt;input type="submit" name="submit" value="&lt;?php echo $this-&gt;__('Submit') ?&gt;" onclick="if(customForm.validator &amp;&amp; customForm.validator.validate()) this.form.request(); return false;" /&gt; &lt;/form&gt; &lt;script type="text/javascript"&gt; //&lt; ![CDATA[ var customForm = new VarienForm('test',false); //]]&gt; &lt;/script&gt; </code></pre> <p></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload