Trying to get jquery validate to work with jqtransform. I see the problem
seems to be the hidden select box. It does not add the error class to this element
so it does not continue to add the error message! If I make jqTransformHidden class
to display:block; it works but then all my inputs and selects are visible, which I do not want of course.
As you can see no error class is added.
<select class="required jqTransformHidden" name="currency">
<option value="">Choose Currency</option>
<option value="29">ANG - Netherlands Antilles, Guilders</option>
</select>
I had exactly the same problem, and this is how I got around it.
I use jquery validate for vaidating everything except select boxes. Once jquery validate thinks my form is valid, I set up another custom validation for select boxes.
You can check that within the selectHandler.
submitHandler: function(form){
if(validateSelect()){
form.submit();
}
},
And then you can create a validateSelect function to check your select boxes. You can use the jquery .val() for that.
validateSelect = function(){
if($('#my-select').val()==""){
return false;
}else{
return true;
}
}
UPDATE: I have found a much simpler solution ! You can force jQuery Validate to check hidden fields by turning ignore: ":hidden", into ingnore: "", in the validate script at line 218. That way, every transformed field will still be validated. You might also be able to set this change in your custom script instead of the plugin script, but I am not sure how to do so.
I know this is an old question, but for all those who are struggling with this, here is my solution:
In my case it seems like using ignore: "" does not do the trick to select inputs. Instead of hiding the hidden fields with CSS display: none I used position: absolute; top: -9999px; left: -9999px;
The easiest way is to edit the jqTransform.css file like this:
.jqTransformHidden {
//display: none;
position: absolute;
top: -9999px;
left: -9999px;
}
Related
I use kendo-ui dropdown.
I add some ovveriding-css, and it works well.
.k-animation-container {
//this is popup that is html is rendered out of the page element
//so it cannot be selected by id / panaya class / panaya element
.k-popup.k-list-container {
.k-item,
.k-item.k-state-selected,
.k-item.k-state-focused {
background-color: transparent;
color: $darken-gray-color;
margin-left: 0;
margin-top: 0;
}
}
}
The problem is, that while each dropdown has other input element instance, the list has one instance that is hidden and when you click any combo - is shown near the currently clicked combo.
What say - when you ovveride the list-container style - dows it for all of the combooxes.
Is there any solution for this issue?
Well this is a known problem, for every popup kendo renders independent div with class k-animation-container
You can try with this solution suggested on telerik forum:
k-animation-container
$("#spreadsheet").on("click", ".k-spreadsheet-editor-button", function(e) {
var animationContainer = $(".k-animation-container").last();
// use some custom conditional statement that will determine if this is the correct list popup, e.g. check what's inside the popup
if (true) {
animationContainer.children(".k-popup").css("min-width", 200);
}
});
Didn't try it my self, gl.
One solution I found was to use
popup: {
appendTo: $(some parent with ID)
}
This way we can manipulate styling of that particular .k-animation-container.
But this doesn't work on every widget, unfortunately.
My team find a great solution:
There is an option to give the input-element custom id.
Then you can select the list-container by the custom id you gave +'list' str.
Now, if you want to get the k-animation-container, you can select the list element and then request its parent.
Code sample:
The input element:
<span
kendo-multi-select
id="my-type-dd"
k-options="$ctrl.getVMultySelectConfig()"
k-ng-model="$ctrl.selectedTypes"
></span>
Selectors:
If you need only the k-list-container and not must the k-animation-container, you can do that by css:
.k-animation-container #my-type-dd-list {
//this is popup that is html is rendered out of the page element
//the id is the id you give to the element + '-list'
&.k-popup.k-list-container {
padding: $space-normal 0 $space-small $space-small;
box-shadow: 3px 3px 1px rgba(0, 0, 0, 0.1);
}
}
If you need the k-aniamation-container you need to select it by jQuery becouse css doesn't have parent selector:
var kAnimationElement = $("#my-type-dd-list").parent();
I'm facing difficulty to solve an issue. I have made a custom pagination in my view page, but the pagination items get line breaks like following picture:
I tried to avoid that by adding <div>, but couldn't get it solved.
I used the following line just after the end of my </table> tag.
{{ $managementReport->render()}}
There's nothing wrong with your pagination code; it's likely just outputting an unordered list, in which every item is rendered in it's own line by default. You can easily override this behaviour with plain CSS using the following rule (I'm assuming you've added the .pagination class to your ul):
.pagination {
padding-left: 0;
list-style: none;
}
.pagination > li {
display: inline-block;
}
I have written some javascript under a text item html and it is working perfectly when in eclipse birt designer. When I deploy the report to Birt viewer in apache, it does not seem to work. I am not sure if the click is not working or the javascript behind it is not working but something is wrong the I am not getting the desired result on clicking the text item
Basically, I am hiding few charts when I click on the text item (I wrote an html script to make it a button and then called a javascript function to hide a chart). It is working in birt designer but not working in birt viewer on apache
below is the button html script
<button type="button"
style="width: 120px; height: 30px; color: #5a698b; font: bold 12px Arial;
padding-top: 1px; padding-bottom: 1px; background: #ddddff; text-align: center;"
onclick=" showhidetab(1,'Population','2.5in')";">Overview
</button>
here is the javascript function that the button is calling
<script>
function showhidetab(showflag,bookmark, heightval)
{
if (showflag == 1)
{
document.getElementById(bookmark).style.visibility="visible";
document.getElementById(bookmark).style.display = "block"
document.getElementById(bookmark).style.height= heightval;
}
else
{
document.getElementById(bookmark).style.visibility="hidden";
document.getElementById(bookmark).setAttribute("style","display:inline;height:1px");
document.getElementById(bookmark).style.height='1px';
}
}
</script>
Can someone please suggest what could be wrong here
Regards
Syed
Some quick fixes:
Your line document.getElementById(bookmark).style.display = "block" is missing a semicolon.
I think the id should be js3_Population... check in your browser.
The brackets closing the else statement is missing a semicolon.
When I made those changes it worked for me. Your code is only resizing the item and not hiding it since the state of the bookmarked object is already visible. You might consider using style.display="none" to avoid holding space for hidden items.
It says clearly on the documentation
just add data-spy="scroll" to the element you want to spy on (most typically this would be the body)
But it seems I can only get it to work if I put it on the body. When I put it in any other element that I wish to spy on, the last element of the nav gets selected.
Here it's on the body, and it works, and this is the same exact thing but with data-spy="scroll" on the element I want to spy on, and it fails (only the last element gets activated).
Am I doing something wrong or is this a bug ?
Your 2nd example can be fixed by using:
#TryToPutDataSpyHere{
display:inline;
}
But for some reason it doesn't works on the demo
I managed to reproduce your issue from the doc: http://jsfiddle.net/baptme/KbphR/
But it only works if I had the following css code (used on the doc):
.scrollspy-example {
height: 200px;
overflow: auto;
position: relative;
}
http://jsfiddle.net/baptme/KbphR/1/
It seems like height: 200px; and overflow: auto; are both necessary
Not in you case maybe because of your .box{height: 500px;}
I had a similar issue where scroll spy would not work on anything but a tag so I actually went into the bootstrap js found the Scroll spy (SCROLLSPY CLASS DEFINITION) section and changed this line:
, $element = $(element).is('body') ? $(window) : $(element)
to this:
, $element = $(element).is('body') ? $(window) : $(window) //$(element)
(note that the element after the // is a comment so I don't forget I changed it)
And that fixed it for me.
I put jQGrtid inside jQuery simple model dialog.
z-index of simple dialog is 950 so i changed the z-index of jqGrid edit/add/delete pupups greater that that because otherwise they appearing below simple modal.
.jqmID1 { z-index: 1000 !important; }
.jqmID2 { z-index: 1000 !important; }
.jqmID3 { z-index: 1000 !important; }
All was looking good but than if i click/close "edit" and than click/clase "add" and than back to "edit" jQGrid popup again displaying below simple modal.
Than i find out than each time .jqmIDn increasing the n value for each new opening popup so my fix working only for 3 first popups ant than when value getting increased .jqmID4 .jqmID5 .... in is not working
Is there anything i can do to fix that? should i change jQgrid.js somewhere?
UPDATE:
OK, as a solution to that I've found a way how to change z-index in simple modal instead, so i decrease it like that:
$("#myDiv").modal({
...
zIndex: 800,
...
});
If someone have any another ideas let me know
You can use zIndex property of the Add and Edit Dialog. See this and this answers for details.