Its funny sometimes being experienced we make such mistakes that we never had imagined. Scenario I had to send to form with multiselect values but these were not getting posted Funny Reason I was moving values to right box but values were not selected as you can see in previous image above and I was Continue reading
Jquery
Fancybox Title Options & Stylings
Fancybox is a Jquery’s gallery plugin and it comes with four options to display title of image in overlay. Here are these four options are displayed with image examples. Floating Title This is default and if you don’t mention any type for title then title will use Float option. I won’t recommend it because the Continue reading
Most common tasks in Jquery and Javascript
Confirm Alert Before Deleting or Similar Action
1 2 3 4 5 6 7 8 9 |
function removeProgram(){ if(confirm('are you sure you want to delete program?')){ //do whatever here } } //---OR---// <a href="delete/123" onclick="return confirm('are you sure?')">delete</a> |
Check If Variable is Undefined Or Has No Value
1 2 3 4 |
//To check if variable "data" contains any value or not. if(data !== null && data !== undefined){ //Do whatever here } |
1 2 3 4 5 6 |
//you can write following code in document.ready function $('#id_of_input').keypress(function (e) { if(e.which ==13){ //13 is numeric value of enter key form.submit(); } }); |
Hit Enter Inside Input Field And Submit Form