The selection option does not work for Modal

Can someone help clarify here? I am trying to do the same thing as this post but set the value dynamically. However when I do this, even though I'm setting the values before opening the modal, the value does not seem to be getting set. I have a Creat

The simplest visible timer in the Rails application

I am trying to do front-end timer that would precisely show time left (in minutes and seconds). This timer is supposed to count, even when user left the site or even close browser. Although I thought of simple way to do the back-end part of it, I hav

jquery validates the state of the value

I would like to code a validation on button radio. (yes or no). Thanks. my code : conditions : { required : { depends: function(element) { if ($('#conditions')val('Yes').is(':checked')){ return true; }else{ return false; } } } }, You probably want to

Make an image in a div act as a background image cover

Trying to have an inline image auto crop inside a div to simulate a background image. I tried using absolute position with a size larger than 100% but when you resize it works for the height one time and then breaks for the width another. I am assumi

PHP + HTML - If anything else, hide the button

This is my php code: if ($value = $rec['ip'] <= $cphigh_ip && $cplow_ip <= $value = $rec['ip']) { $cpyes="on "; $realString = $value = $rec['ip']; $whmLink=$realString[strlen($realString)-1]; } else { $cpno="not on cPanel"

Save the php json object in jquery variables

I would take a php json object and save it in a jquery variable. <?php $arr = array(); for ($i = 0; $i < 5; $i++) { $arr[] = array('id'=>$i, 'text'=>$i); } $arr = json_encode($arr); ?> <input id="phpObj" type="hidden"

jQuery .append () is not synchronized?

My goal is to add a hover class on a div, and have a transition effect on it. But I need to append the element to the parent first, just to make it always on top of the others. This is a trick to simulate the z-index effect when z-index is not availa

Jquery AJAX GET with an email and ASP.NET ApiController

I have an action that checks if a user exist based on the username or email: [Route("check/{usernameOrEmail}")] [ResponseType(typeof(bool))] public IHttpActionResult GetUserExists(string usernameOrEmail) { var user = db.Users.FirstOrDefault(u =&

How do I select JavaScript & ldquo; Id & rdquo; by var?

All I want is set getElementById by var (it must be automatic because I have got multiple of this range inputs (brightness, contrast, sharpen, etc.). How can I do this? function showVal(value, id) { var spanId = "#" + id + "Id"; docume

How can I pass an event as a jquery callback method?

i'm having trouble solving an issue i'm facing regarding jQuery. Some Background: I'm working on a project where I take Json files that represent questions. A simplified version of the Json is as follows: { "questionOne": { "id": "

Using getScrollTop to work: Evacuate items

Not sure how exactly to make it so that the navbox is opaque after scrolling until hovered over, I would also like to incorporate CSS3 Transitions into this. This is the working code without hover: <Script> window.onload = function() { function getS

Slickgrid - Replacing all AJAX source grid data

In the app I'm building, I have a data grid and some select boxes where the user can set filters and upon a selection it makes an AJAX call to get a new array of data from the server. I have the grid initializing with default filters, but I can't fig

Jquery Click Function Only Working Twice

im having a strange problem with a jquery click function. What is suppose to happen is the user clicks a link '.selectlink' and it ticks a box on the page. This works just fine, click it again and it unticks the box.....also fine, click the link once

How to track the use of the jQuery plugin

I'm about to finish a jQuery plugin. I will sell licences. Open source project will be able to use it for free. I don't care if some people will use it although they are not allowed to. But it would be cool to track the usage of the script. I don't w

Using eventjs with non-working angulars

Greetings Overflowers, Using angularjs bind function to register event handlers on elements does not work when including eventjs script! I was under the impression that eventjs will replace default addEventListener function to its own which will be u

Adding arbitrary data to Jquery using .data ()

I was trying add arbitrary data while doing this I got following doubts in my mind: How much data I can add, is there any limit? Does it affect in anyway to performance/execution Speed? And what about safety of data, is it safe? Where does these get

Problems with toggle, hide and show (Jquery)

I've been looking all over for a script that will take care of the following issues: http://jsfiddle.net/k7E9V/3/ Close the div when clicking outside of it. Close one div when the other one is clicked. Close the div when "More info" is clicked a

Using $ (this) in setTimeout ();

I want to set timeouts dynamically in jQuery. The dynamically set timeout functions need to use $("this"), but I can't seem to get it working. An exmple: $("div").each(function(){ var content = $(this).attr('data-content') setTimeout(&

Ajax does not trigger server action

I am trying to trigger action via ajax but it doesn't call from some reason. Is my js code fine? @Html.ActionLink("LIKE", "LikeComment", "Comments", new { id = 1985 }, new{@class = "likeButton"}) $(document).ready(f

Check the session before each success of Jquery Ajax

I have implemented a project in MVC and there i have done most of the thing with ajax request. but we are facing a issue of session time out. So i want some thing with ajax that before doing any ajax request it check the session and then process that

jQuery .position conflicts with the CSS3 transformation

I have a problem on jQuery .position function. It conflicts with the transform rotate of CSS3. I am getting the position left and right of an image inside the rotated div. The result of .position if I rotated my DIV is different when the div is not r

Jquery and CSS background change

I am having problem with the following line: document.getElementById("giftcard").getElementsByTagName("label").style.backgroundImage ="url(giftcard_icon-d.jpg)"; I am trying to change background image after clicking a label.

jQuery: keypress Backspace will not fire?

I wonder what I'm doing wrong: $('.s').keypress(function(e) { switch (e.keyCode) { case 8: // Backspace //console.log('backspace'); case 9: // Tab case 13: // Enter case 37: // Left case 38: // Up case 39: // Right case 40: // Down break; default: do

How to delete the script tag added by ajax multi-domain?

I am using the JSONP/dynamic-script-tag technique to perform cross-domain AJAX (There's no XML, but you know what I mean). Initially, I wrote my own solution, but I could not come up with an elegant way to remove the script after it executed. My stra

to call a function on a page from a link on another page

I have an html page (django) that contains several divs(each displaying different data) and one div that has navigation links. I'll call this my main page. I have an external .js file (jQuery) that reveals one display div on the main page and simulta