AUI in-built validator not working - user-interface

I wrote some simple code in liferay to make use of the in-built aui validator, like so:
<div id="addDiv">
<aui:form name="fmAdd" id="fmAdd" action="<%= addURL.toString() %>" method="post">
<aui:fieldset>
<div>
<aui:input id="addName" name="name">
<aui:validator name="required" />
</aui:input>
</div>
<div>
<aui:input id="addDescription" name="desc" >
<aui:validator name="required" />
</aui:input>
</div>
<aui:button-row>
<aui:button type="submit" id="btnSubmit"/>
</aui:button-row>
</aui:fieldset>
</aui:form>
</div>
In another project the same code works fine, and for this jsp it recognises that it's a required field since it appends (required) at the end of the input labels. However, the javascript validation doesn't work. When I click the button without filling in anything the whole form just submits anyway.
Am I missing something? I'm very confused right now so any help would be greatly appreciated!! Thanks!
Edit: For some reason, this problem solved itself without me doing anything. I'm not sure what happened, but it suddenly started working. Can someone advise me as to what I should do with this post? Is there a way to remove it?

I think I have figured it out. I faced the same problem. Validation stopped working when I added another form in an included page.
When I added 'name' attribute to each forms it started working again.

It can very well be a bug that is mentioned here in the link.
http://issues.liferay.com/browse/LPS-15050

Related

AMP form issue in a MVC framework

I am having an issue with a form using AMP.
The form works perfectly on a standard amp html page - the button is clicked and the search.php is triggered.
<form method="post" action-xhr="search.php" target="_top">
<input name="query" placeholder="search" id="query" size="40" value="">
<button type=submit class="btn-search"><amp-img ></amp-img></button>
<input type=hidden name=search value=1>
</form>
Then the exact same code (including all the includes, etc) on the MVC framework I am using doesn't work. The button is clicked and nothing happens.
Source codes on both are identical when viewing page source.
Should this not be happening - the specific MVC framework I am using possibly has an issue with this?
Or is it due to it being MVC, the view (header.twig) has the form on the not working version. Would the php code from search.php go into the controller?
Any help would be greatly appreciated!

AntiSamy is not allowing me to input form fields

I have a RichTextArea from CKEditor. And I recently made some changes to sanitize HTML input.
Normal things go through fine but any form fields like checkboxes, textareas, radio buttons etc are stripped out.(I am using getValidSafeHTML to sanitize my HTML).
I have tried different policy files like this thing here which is supposed to allow everything
http://code.google.com/p/owaspantisamy/downloads/detail?name=antisamy-anythinggoes-1.4.4.xml
For example,
<form method="get" name="sampleform"><input name="radio" type="radio" /> </form>
becomes
<form method="get" name="sampleform"> </form>
Anybody have any idea why this is happening?
Thanks in advance
I just found the reason why this is happening... I was using the antisamy-1.3.jar. This looks like a bug in this version of antisamy. I needed to upgrade to antisamy-1.5.3.
So just check the versions of your antisamy jars. You might be facing the same issue

In Magento site ,My checkout button is broken

not sure why my magento site
all links broken, My check out button link showing me like this error
<form "="" getformkey="" varnishcache="" www.alphacateringequipment.com.au="" https:="" action="https://www.alphacateringequipment.com.au/checkout/cart/add/uenc/aHR0cHM6Ly93d3cuYWxwaGFjYXRlcmluZ2VxdWlwbWVudC5jb20uYXUvYmV2ZXJhZ2UvYWNjZXNzb3JpZXM,/product/3704/form_key/<esi:include src=">/" method="post" id="product_addtocart_form_3704">
<button onclick="productAddToCartForm_3704.submit()" class="form-button listing_cart-btn">ADD TO Cart</button>
</form>
and also my site drop down menu not working more
if any one know this
Please help me out.
thank you
Try below code.
<form name="text" getformkey="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" varnishcache="" www.alphacateringequipment.com.au="" https:="" action="https://www.alphacateringequipment.com.au/checkout/cart/add/uenc/aHR0cHM6Ly93d3cuYWxwaGFjYXRlcmluZ2VxdWlwbWVudC5jb20uYXUvYmV2ZXJhZ2UvYWNjZXNzb3JpZXM,/product/3704/form_key/<esi:include src=">/" method="post" id="product_addtocart_form_3704">
<button onclick="productAddToCartForm_3704.submit()" class="form-button listing_cart-btn">ADD TO Cart</button>
</form>
It will broken due to form key not passed by In Version of Magento.

Search-form action attribute with Advanced AJAX Page Loader wordpress plugin returns "more than one title tag on the page.." warning in debug mode

I'm trying to enable search functionality of the Advanced AJAX Page Loader plugin on a custom wordpress theme I'm building, but after I enter keyword into search and hit enter, loader.gif keeps on spinning and I get this message in debug mode : "WARNING: You seem to have more than one title tag on the page, this is going to cause some major problems so page title changing is disabled". It also passes the url of the website twice into the address bar and I believe this has something to do with the action attribute that's being passed by the form.
This is the site in question: http://natalija.co.nf
I left the debug mode of the AAPL plugin on for now
This is my searchform.php code:
<form method="get" id="searchform" class="searchform" action="<?php bloginfo('url'); ?>">
<input type="submit" id="searchsubmit" value="" class="btn" />
<input type="text" size="10" name="s" id="s" value="" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;"/>
</form>
I managed to ajaxify the theme with this plugin but I 'm having trouble getting the search to work properly so I was wondering if anyone here can help me out with this? It is driving me crazy.
I solved it. The code in search.php needs to be wrapped with a div class="searchform".

dojo.connect not working in IE but sometimes in chrome&firefox

I finally got some parts working here: http://jsfiddle.net/trXBr/5/
but when I put the code back into my project and tried to browse using internet explorer; the button onclick events do not work. Interestingly the one button onclick function to show the dialog works in firefox and chrome. I was excited to have this working in the editor but now if this does not work with all browsers, then this is just really frustrating. I am using version 1.5.1
dojo.connect(loadBtn,'onClick',function(){
userDialog.show();
});
dojo.connect(butt,'onClick',function(evt){
showTab();
});
Any help/ideas appreciated.
EDIT:
Ok using the compatibility mode in IE helps to get the one function working which displays the dialog box.
So as you can see here I have an borderlayout where I want a tabcontainer to be displayed in the middle with a click of a button and this works fine in jsfiddler but not from my code in the browsers;
<div dojoType="dijit.layout.ContentPane" region="center" splitter="true">
<div id="mainTabContainer"dojoType="dijit.layout.TabContainer"
style="width:500px;height:100px;display:none">
<div id="tab1" dojoType="dijit.layout.ContentPane"
title="First Tab" selected="true"
closable="true">First Tab</div>
<div id="tab2" dojoType="dijit.layout.ContentPane"
title="Second Tab" closable="true">
Second Tab
</div>
</div>
</div>
so the display:none but when I click the button I call the following:
dojo.connect(butt,'onClick',function(evt){
showTab();
});
function showTab(){
dijit.byId("mainTabContainer").domNode.style.display = 'block'
dijit.byId("mainTabContainer").resize();
}
Also if I remove the display=none then the tabcontainer appears fine. So is these something wrong with my function call.
ok sorry guys....all my fault here...I forgot to remove the added code I had in my html in my asp.net code
<body class="claro">
<form id="form1" runat="server">
<asp:ScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ScriptManager>
Once I removed the form and scriptmanager lines it works fine..Thanks for everyones efforts.
Just worried that if I were to incorporate ajax and other controls, then would dojo still work

Resources