adding text field if no previous, or previous is not empty
Hello, I have a form, where user can add skills, with text field. When page load, there is just one field. What I'd like to do is : When that field get focus : - if there is no previous similar field OR if this previous field is not empty, AND if the current field is empty, add a new text field AFTER the current field. So I don't need any "add new field" button, the script auto-add a new field, if the user is filling the last empty field. I tried this way, but that doesn't work : function add_competence_field()
Image changing problem
I have problem with this script. It should change images according to on which link you hover. I suppose it is written good and I have no idea why it doesn't work .. $(document).ready(function() { $(".byt").bind("mouseenter",function() { stary_byt = $("#patro").attr("src"); novy_byt = $(this).attr("id"); $("#patro").attr({src : "patra/"+novy_byt+".gif"}); }).bind("mouseleave",function() { $("#patro").attr({src : stary_byt}); }); });
Show/Hide Image
Hello, On a page I am displaying 10 images. All have the same CSS class, "Photo" and the same Width and Height, 200px by 100px. I used the CSS class Photo to resize the images to 100px by 50px. I would like, when the mouse is over an image, to show it full size, maybe in a div floating over the thumbnail. And when the mouse is out of the thumbnail to close the big image. Can I do this? Thank You, Miguel
Pre-Homepage fadeOut()
Hi ! Warning -> Newbie. I know it is possible with jQuery : I have a pre-homepage with 2 buttons : First button click goes to Homepage n°1 Second button goes to Homepage n°2The purpose is that I want a fade out of my Pre-homepage and the fade in of the selected page. Can you help me ? Thanks a lot
Binding Data to Gridview
Hi All, I am working for ASP.Net MVC applications, I have a requirement to display the HTML control names and Id values into grid view. I know how to find the HTML control names and ID's, below is the code snippet to find the control names and id's. <script language="javascript" type="text/javascript"> $(function($) { $.map($("form > *"), function(e) { if (e.type != "hidden") { alert("HTML ControlType:- "+ e.type+" ' " +"And" +"Control Name:- "+ e.name); } }); }); </script> But my requirement
.change() unbind and rebind
Hi folks, I have a column of input boxes in a table that have a .change(fn) event bound to them on doc.ready on the basis of their class. I need to dynamically add more rows to that table, which I can do fine, but obviously these new input boxes don't get that event bound to them. I have tried using .live('change', fn) but as I understand it this doesn't work in IE due to event bubbling, correct? So next, I moved the $('.<classname>').change(fn) to its own method (called BindInputs() ) and am calling
How To pass PHP variable To Jqueruy
I am using Jquery for form validation. So after the validation find true, from that validation.php , i want to pass a PHP variable to custom.js( Jquery file). How can i do it. I am getting validation errors as a concatinated string which is returned by php, am trying to append a variable to that string. but its ech oing on the screen. Is it possible to assign a variable in that PHP file and pass to jquery file. Thanks In Advance Zod!
Remove string using regular expression
Hello there! I have function: Copy code function Dummy(){ adress = window.location.href; regex = "/^&(.*?)?$/"; adress = adress.replace(regex,''); alert(adress); }I want to remove all parameters, but first. I don't know what's wrong .. :-(
:has selector can't catch a class?
Hi Folks, $(".mainmenu-topcontainer > ul > li:not(:has('.stateselected'))").hover(function(e){ (...) I tried it with and without quotes. Do I miss anything? That selector matches all Li elements.
Bug in IE for some reason, with AJAX
Hi, For some reason, when caling this function with only selected_id and field_num defined, we get this error (ONLY in IE ... tyical!) Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; InfoPath.2; OfficeLiveConnector.1.3; OfficeLivePatch.0.0; .NET CLR 3.0.30729) Timestamp: Wed, 10 Feb 2010 17:12:05 UTC Message: 'optionValue' is null or not an object Line: 452 Char: 10 Code:
Newbie: addClass problem
I have this markup: <!-- FRAME ONE --> <fieldset> <legend class="some_class">Anbefales</legend> <input type="radio" /> <span>Visa/MasterCard.</span> <div>Some text: <b class="pink">BOLD PINK TEXT</b> some text.</div> </fieldset> <!-- FRAME TWO --> <div class="final_radio"> <input type="radio" /> Some text </div> There are two radio buttons, sometimes one will be disabled, other times the other will be disabled. I would like to make a script that: First: Changes
.load() results in [Object object]
To start off with i'll post my code that's giving me the issues here and also, i have the scripts put into the page itself in the header so javascript calls are working it's just not working properly. <a href="javascript:$('#reusepanel').load('main/tos.php #tos');" class="mainpage"> --Terms of Use Agreement-- </a> now then on the page called conveniently tos.php here is teh anchor for it's part. <form id="tos"> <ol> <li><strong>Terms of Use Agreement</strong></li> <--snipped text --> </form>
different menu items on rght click of a grid
Please guide me to acheive below results, 1)Need to display menu on right click of a data grid using Jquery, 2)I need to disable or hide some of the menu items in certain rows, 3)postback to the server with the selected row details Many thanks for looking into this..............
Issue with removing alert box in $().ready
i have a jsp page using the following call $('plugin_search').ready(function() { resizeIframe('plugin_search'); alert("this was called"); }); to call the function resize iFrame and this works perfectly fine with the alert in it. The moment i remove the alert it stops working. Can some one help me figure out how to do this .... thanks
How to select a links href value, then load that link into a div.
Hi: Jquery beginner here. I have a 2 column page. Left nav which contains a list of items with links to their respective details page. What I'd like to do is to load that link into the div in the right side of the page. I want to do this via Ajax, so I don't have to reload or redirect the page. I do have my layout coded, but my jquery code is not even close to work, so I didn't post it here. Any help is greatly appreciated. tx Kamy
Problem with .load() and browser close
Hi, have a problem with .load() i hope you guys can give me a hand. The following list - File 1 | 0% | Process - File 2 | 0% | Process each file is a xls file with 10000 or more cells to process Process is a link, with the following code. <a href="process.php?4a7af260640d6b198e846d58e69037224.xls" onclick="procesa_archivo(this.href, 4); return false;">Process</a>The procesa_archivo function is as follows function procesa_archivo(url, id) { $("#archivo_"+id).html("<img src='/images/indicator.gif'
How do I select certain elements that have been added to the DOM dynamically?
Hello, I have a markup structure like this. <div class="gallery"> <div class="slide"></div> </div> I will be adding 3 additional <div class="slide"></div> after the first one dynamically on $(document).ready(). In the DOM, it looks like this. <div class="gallery"> <div class="slide"></div> <div class="slide"></div> <div class="slide"></div> <div class="slide"></div> </div> First, I append the divs like this rootElement = $(".gallery"); rootElement.append('<div
JQuery - Toggle (newbie help)
I've nearly gotten this code working, however, IE7 is showing some padding between the top tab and the div directly underneath it and I can't figure it out. I realize that this might be a CSS issue, too. So I apologize if this is the incorrect forum. Here's the code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js"></script>
how to get the id of the div clicked
$(document).ready(function(){ $(".button").click(function () { $.ajax({ var turl= "" + this.id + '.html'; url: turl, success: function(data) { $('#content').html(data); alert('Load was performed.'); } }); }); }); This doesn't work. How to get the id of the .button where .button is <div>. Thank you.
jQuery Ajax return, scroll up to div error message container
Hi everyone I'm AJAXifying a whole bunch of forms on our website and I'm using the BlockUI plugin. That's working great. I test the HTML that's returned from the AJAX call and if it contains the text "box_error" then I unblock the UI and output the returned HTML into a DIV above the form which displays the error message to the user. If it contains "box_success" then I unblock the UI, animate the form away and animate the success message in the form's place. Really creates a great effect and provides
Spotlight/glow effect
Hi, I am wondering how I can make a spotlight/glow effect using jQuery or are there any plugins out there. Initially, this is how it is going to look: When a user mouse-over it or click on the link, it will turn into: Right now, it is an image link, but I want to use text link instead. The green section is a div. So, I just need help with how to make the spotlight/glow effect in image 2. Thanks!
Customising this code
Hi everyone, I decided to use the tutorial over at PacktPub mainly because I didn't need all the features of DataTable and I didn't want to have to spend a lot of time trying to get it styled exactly how i wanted it. My problem with this tutorial is the pagination. I dont want it to look like this: 1 2 [3] 4 5 Instead I want it to look like < [#] > The [#] will be an input field where the user can enter in a number and it will automatically go to that page. The arrows on either side, they will disable
Hiding tbody problem
I have searched the forum and cant seem to find anything relating to this. I have a fixed layout table that uses a tbody with an image for the header, with the contents to display loaded in the next tbody. I can expand and collapse the "contents" tbody using show() or hide(), however, in IE7 the rows are remaining visible and dissapear randomly. This problem does not exist in Mozilla. Additionally, if i remove the table-layout:fixed, everything works like it is supposed to in IE. Has anyone
jquery doesn't work in a script empty tag
I'm really not sure if it's a bug or the problem is in my code, but, when I try to run this code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title> New Document </title> <meta name="Generator" content="EditPlus"> <meta name="Author" content=""> <meta name="Keywords" content=""> <meta name="Description" content=""> <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"/> </head> <body> <a href="">Link</a> </body> </html>the
plz i need help to anchor and Highlight post in new pages by clicking a link in home page
i want to create EBook but and I'm a Noob in JavaScript and jquery so i made this example hoping some one could help me to tell me how i do it example : i have 3 pages: 1.home.html 2.page1.html 3.page2.html home page have 2 link : goto page1 post2 goto page2 post5 when i click one of the links in the home page example : "goto page1 post2" it will go to the post 2 which is inside the page1 and Highlight the current post "post2" with yellow color i made this graph to express what i want to do
Need to add a class based on certain condition
How could I add a class to a div that contains a div that contains a link that contains specific text, and name that class based on that link but with hyphens in place of spaces and all lower case? Here's specifically what I'm looking for: <div class="my-div-one"> <h2>Title of this section</h2> <div class="my-div-something-else"><a href="url">My Special Link</a></div> </div> In the above example, I want to add the class my-special-link to my-div-one. Is that possible? How could I do that? Thanks,
How to remove table with html page?
I have table called <TABLE ID="ECBItems" style="display:none" height="0" width="0"> I need to remove this table in loading. how can we do that?
Animating a horizontally and vertically centred DIV
Hi, i've been wrestling with this issue for the last hour. I can't seem to get this centred div to animate properly. What it currently does: A small div, (10x2px) expands to full 100% width and 100% height. However, it expands in the bottom right hand corner of the screen. What I am trying to get it to do: To expand equally in all four directions. Please help me with this. Im new to jquery and would appreciate your help. Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
making sure ui can be manipulated
hello, the first thing you learn about jquery is that you can only start manipulating dom objects in your code once your page is 'ready' (e.g. $(document).ready(...)). i am wondering what the pattern is for cases when scripts are loaded dynamically (e.g. jsonp) or run inline as a part of dynamically loaded content. can one safely assume the DOM is ready at this point? hope it makes sense, thanks
Selecting classes that start with 'foo'.
The following gives me an error: $("#main_content div[@class^='std_side_image'] .caption").each(function(){ Warning: Expected attribute name or namespace but found '@class'. Source File: http://zarathud.org/test/0208test-post-for-my-hack.shtml Which, now that I think about it, is probably b/c I've mixed CSS-style and XPath-style selectors. I haven't figured out how to write this as XPath-only. Is there a way to say "all classes starting with 'std_side_image'" in CSS style? thanks! CC, relative
PHP / JQuery induced headache.
Ok so I'm starting to go insane. I cannot for the life of me figure out why I can make text in my navBar fadeIn and fadeOut with jQuery no problem on my HTML document but the second I try and use the .js file on my .php the .hover() does not work. Anyways, I'm not sure if anyone here is great at JQuery and PHP but I've spent hours trying to figure out what I'm doing wrong and I could really use another couple pairs of eyes... HTML File: [code]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
caching getJSON results
I'm new to jQuery, so I may be missing something, but I'm seeing what seems to be strange behavior using the getJSON method in 1.4.1. Basically, I attempt to save the results of the call in a global variable or a data object, but it is not available outside the function passed to getJSON until the second time I try to retrieve it. Here is an example with some comments indicating what I'm seeing: <script type="text/JavaScript"> function getJSON() { if ($(window).data('myjson')
Mouseout
This code is working perfect to mouseover: $(document).ready(function() { $("#main ul li").hover(function(){ var fade = $('img.g-img', this); fade.fadeTo('slow', 0.5); $("#main ul li").removeClass("active"); $(this).toggleClass("active"); }); }); But what about mouseout? I want to remove effect like "removeEventListener" in as3.0, How can I do this? Thanks in advance
jquery 1.4 how to give pause / delay to this line ?
how to give pause / delay to this animation ? $(document).ready(function(){ $('.boxgrid.caption').hover(function(){ $(".cover", this).stop().animate({top:'0px'},{queue:false,duration:300}); }, function() { $(".cover", this).stop().animate({top:'100px'},{queue:false,duration:300}); }); }); this is a slide up and down animation and I need a delay before the slide down of that line thanks
Return Custom Error Using .post
Ok, so having trouble finding my answer because I'm not sure what to search for. I know how to POST to my PHP script, but I want that PHP script to return a custom value back to my original page. I'm doing come credit card processing, and I want to return the status (declined, approved, etc). This return status would determine what my .slideUp function looks like. I hope I'm making sense? Please help :)
Converting mootools code into jQuery
Can anyone please help me in converting this mootools code into jQuery: window.addEvent("load", function () { if (window.ie6) { $$("#horiz-menu li").each(function (e) { e.addEvents({ "mouseenter": function () { e.addClass("sfHover"); }, "mouseleave": function () { e.removeClass("sfHover"); } }); }); } }); window.addEvent("domready", function(){ // necessary classes Fx.Height = Fx.Style.extend({
Problem getting parent value
Hi I have the following table <table> <tr> <td><input /></td> <td><select> </select><a id="link"></a></td> </tr> </table> I'd like to get the value of the input and select elements when I click the "a" tag with the parents method?, I tried: var input = $(this).parents('td input').val(); var select = $(this).parents('td select').val(); But I get "undefined", any ideas? Thanks in advance.
Superfish with JavaScript disabled
Hello every one, I'm using this so nice menu superfish nav-bar style . This works perfectly but if somebody doesn't have Javascript activated there's something wrong, the last submenu of the current page ( "subitem 2d" ) stays in place when i'm on the 2 lasts menu item. It's always present That's a reel probleme cause i love this menu but a lot of people doesn't want JS on their computer, and the menu has to be reachable I can't success to solve it, does somebody have an idea ? Excuse my poor english,
automatic date insert
hello, there are 2 fields in my newform.aspx. 'Problem'(dropdown list with values test1, test2) and 'Solution Date'. i want to auto fill the field 'Solution Date' depending on the value of the dropdown list. test1: solution date= current date + 2 days test2: solution date= current date + 5 days i don't know how to write the current days + days into the field 'Solution Date'. can somebody help me? thanks
jQuery 1.4 - upgrade issues
I'm a little speechless, but getting my bearings again. Just "test" upgraded our Framework from 1.3.2 to 1.4 of the jQuery core. We have over 40 plugins/controls/custom jQuery based scripts (350k uncompressed) built into this MVC framework and I was hesitant to push the new code (although, in reality, it took about 5 minutes to redirect to the new library and run through things "at a glance"). NOTHING stands out as an issue... no errors, no misplaced elements, no failures on rendering. I thought
Next Page