Textbox can't PostBack On Chrome - textbox

I have a problem.
I can't use my Textbox On Chrome, when i set my ImageButton Enable is false, Textbox not working(It not PostBack)
Then i reset ImageButton Enable is true , Textbox can PostBack.
But I need Textbox can work when ImageButton Enable is false.
what can i do ?

Related

Disabled button still responds to click

I have made a button disabled by adding class (.addclass) its still disabled but clickable. But if I made that button disabled by adding .attr then its working as expected. How can I make a button disabled and not clickable by using .addclass in jquery
$(this._eButton).addClass("disabled");
//this is allowing the button to click even button is disabled
$(this._eButton).attr("disabled", true);
//this works as expected

Edittext remove focus

I have a dialog in which there is an edittext and datepicker. After I set the date using a DatePicker, the date focus goes to edittext and shows the keyboard.How can I disable showing the keyboard after setting date.
you can use beneath line to set the edit text to non editable
android:focusable="false" // disable the editable in edit text
android:inputType="date" // input type
Then, you can set onclick listener to the edit text. Once it click then you can call the datepiker and after clicking ok button in datepicker set the date into the edit text and it can not be editable.

DataAnnotations does not work with hidden tabs

I have a form and into this form, I have nav-tabs from BootStrap.
In my ViewModel, I added the data annotations for each item...
My problem is: when the submit button is hit, the validation occours normally on the active tab, but in the other tabs (that are hidden), the validation seems to not work... it only work if i switch to that tab and try to submit the form again, than that tab will be validated or not.
How can i get the data annotations to work on hidden tabs the same way they do in the active tab?
From the jquery Validation Plugin 1.9.0 onwards, the invisible elements are not validated.
In the bootstrap nav bar tabs, only active tabs are visible so these are only validated.
To enable validation for fields in all tabs you need to change default value of ignore to [], it has default value as hidden.
Use the below code to change the default behaviour and call it at onload method or from view.
$.validator.setDefaults({
ignore: []
});

Make a JQuery disabled button enabled with proper styles

I have a JQuery Button, disabled by default and I need to enable it on certain event.
My problem is that when I just simply remove the attribute 'disabled' the button maintains the disabled jquery css styles.
I removed them by hand:
$('[id$=btnDowloadXLS]').removeAttr("disabled").removeClass("ui-state-disabled").removeClass("ui-button-disabled");
But, then the button is not the same as an active button, onMouseDown it doesn't take the proper style.
I figured out this solution
$('[id$=btnDowloadXLS]').button({ disabled: false });
which I think creates again the JQuery button.
My question is: is there a cleaner, proper way to re-enable a button and that the button gets the proper/by-default enabled styles?
jQuery UI buttons have enable and disable methods that you can call to enable or disable the button:
$("#mybutton").button("enable"); // or .button("disable");
Check the Methods tab of the documentation:
.button("enable");
If you want to toggle it using a Boolean (e.g. enabled), this should also work (documentation):
.button("option", "disabled", !enabled);

Force Hide keyboard in iPad Safari

I have a form in the order;
Textbox
Dropdown
Now when user moves focus from textbox to dropdown, the keyboard still remains and it kind of hides the dropdown options...
How do I make the keyboard hide (onblur of textbox)
I have already tried window.blur and it does not work.
Please help me. thank you.
you can try to focus() on a non-text element.
or
$("#yourTextField").blur(); //jquery

Resources