jquery

Is it possible to do ".value +=" in JQuery ?

Classic javascript: var myvar = document.getElementById("abc"); abc.value += "test"; abc.value += "another test"; Jquery: $("#abc").val($("#abc").val()+"test"); $("#abc").val($("#abc").val()+"another test"); Is there a way to make my Jquery prettier, maybe with a hidden += function that I could use? I know that .val() is not an att...

Label fires click function twice

Hi Is any way to call a function and at the same time save effect on the radiobutton by clicking label? Example (I need open/close fieldsets with checkboxes by clicking labels for radiobuttons) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt; <html xmlns...

How do I use a link instead of the browse button to attach a file?

I have a form like the following: <form id="submit_idea" name="submit_idea" method="post" action=""> <a class="attach" title="Attach a file" onclick="clickAttachment()" href="javascript:void(0)">Attach File</a> <span id="id_filename"/> <input id="id_attachment" type="file" name="attachment"/> <input class="submit_btn" type=...

unable to get jquery clone to work correctly

This is the js code that i have currently <script src="jquery.js type="text/javascript"></script> <script type="text/javascript"> $('input.clone').live('click', function(){ //put jquery this context into a var var $btn = $(this); //use .closest() to navigate from the buttno to the closest row and clone it var $clonedRow = $b...

XHTML DOM manipulation with jQuery

I'm using Firefox 3.5. My doctype is XHTML 1.0 Strict. Let's say I want to insert an image into a div with id "foo"; then I might try: var foo = $('#foo'); foo.html('<img src="bar.gif" />'); This does indeed add the image. But I noticed that this was causing some odd behavior later in the document, which I suspected might be due to XH...

Any Easy jQuery Way to Transfer Text From Several Textboxes to Several Others?

I have a form that requires billing and shipping information. As you can imagine, I have textboxes with repetitive info for 95% of cases. However, in the event that someone wants to be billed in one place and have their items shipped elsewhere, we need to account for that. What I would like to do to enhance user experience is have a but...

Using jQuery to edit individual table cells

How can i use jQuery to click on a table cell and edit its contents. There is a particular column which contains several paragraphs of data, so if possible, have a pop up window with a large text area (or ideally an HTML editor). The changes need only be superficial as i am using another jQuery plugin to scrape the table contents and ex...

How to stop an MVC RedirectToRouteResult JavaScript?

I am designing a site and am trying to be compatible with javascript turned off or on. I have a Controller Action named as follows... public RedirectToRouteResult AddWorkAssignment(int id) { // delegate the work to add the work assignment... return RedirectToAction("Index", "Assignment"); } and my jQuery I do a post $('#som...

how to check the content of a variable on submit.

I have a form that takes some post code, I'm trying to check the given post code by the user with the pre-defined post-code variable <form id="post_code"> <input name="textfield" type="text" id="postcode" size="8" maxlength="8" /> <input type="image" id="submit_postcode" src="images/B_go.png" alt="Submit Postcode" width...

Looking for a web based hierarchical menu editor

I'm looking for a web based menu editor that has the following functionality: implemented in JavaScript, no postbacks to server side code on each edit create menu entries edit menu entries delete menu entries reorganize menu entries create sub-menu entries (a hierarchy) no hard-connected back-end code possibility to load the current me...

jQuery event to trigger action when a div is made visible

I'm using jQuery in my site and I would like to trigger certain actions when a certain div is made visible. Is it possible to attach some sort of "isvisible" event handler to arbitrary divs and have certain code run when they the div is made visible? I would like something like the following pseudocode: $(function() { $('#contentDiv...

Force any HREF in an IFrame to use its parent as the target

I'm currently using an IFrame to sandbox user generated content on a website. This eliminates any styling issues with our main stylesheets. However, when a user generates a link using our rich text editor, we would like the link to open in the parent and not just open the link in the IFrame. I realize you can set a target to the paren...

jquery cycle: return to the first slide

The slideshow can be stoped by: $(this).cycle('stop'); Or it can be paused by: $(this).cycle('pause'); But how can I stop/pause the slideshow and return to the first slide at the same time? ...

jQuery new window with content from modal content on opener page

i think i am not going about this quite right, being very new to jquery. i have a page with 3 recipes on it hidden. when a link to recipe A is clicked it opens in a modal. i want to be able to print just the content of the recipe. so i am opening a new window (nonmodal) and trying to write the recipe to it (depending on which recipe is ...

JQuery, how to find list of div's with similar ID

Hello everybody. I have a structure of html like this: <div id="triger1">some elements inside</div> <div id="triger2">some elements inside</div> <div id="triger3">some elements inside</div> <div id="triger4">some elements inside</div> How do I get array of all the div's in JQuery with the triger ID in them (as you can see, they all h...

Non GPL alternative to JQuery's pngfix plugin

Like the question says the pngfix jquery plugin is GPL'd. I'd like to use it in a commercial way without having to comply with the GPL. Being that there is no way to do so, I was wondering if there is another alternative to this library that I could use? The plugin found here does seem to have limitations that affect my usage. ...

Jquery code on load not firing

Hi, I have the following JQuery code in a external JS file linked into a usercontrol in .Net 1.1 webapp. The usercontrol is a timesheet. When the page loads it calls MonthChange and works fine in one page. But now I want to load the timesheet/usercontrol into aother webpage that pops up a in a new browser window for printing. Probl...

Jquery AJAX Load problem

I'm trying to load all my website pages using jQuery .load method so, thats how my website looks: <script type="text/javascript"> $(function() { $('.link').bind('click', function(e) { var page = $(this).attr('href'); $('#site').addClass('loading'); $('#content').load(page, function (){ ...

replace function in jquery

I am using following code $.post("insertPrivateMessage?action=sendchat", { to: GroupUserArray[count], message: message, username: $("#author").val(), GROUP: chatboxtitle } , function(data){ message = message.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;"); }); but when replacin...

jQuery missing ; before statement

Hi guys, I have a problem with jQuery, my code looks ok, but I'm getting an error, which sounds like this: missing ; before statement [Break on this error] }elseif($('.v_gallery li:first').hasClass('s')){\n And my code looks like this: _gallery_pag : function() { $('#top_pag a').live('click',function() { ...