validation using conditional statement
I have the following code: <select name="selCompletedBy" id="selCompletedBy"> <option value="Dr">Dr</option> <option value="Nurse">Nurse</option> <option value="Therapist">Therapist</option> <option value="Psychologist">Psychologist</option> <option value="Other">Other</option> </select> <input type="text" name="completedOther" id="completedOther" size="45" maxlength="50" validate="required:true" > Then in the validation : completedOther:
Problem using 2 jquery files in 1 file
<script type="text/javascript" src="js/jquery.js"> </script> <script type="text/javascript" src="js/jquery.lightbox-0.5.js"> </script> <link rel="stylesheet" type="text/css" href="css/jquery.lightbox-0.5.css" media="screen" /> <script type="text/javascript"> $(document).ready(function() { $('a.lightbox').lightBox(); }); }); </script> <script type="text/javascript" src="jquery-1.8.2.min.js"> </script> <script type="text/javascript" src="jquery.cycle.all.js"> </script> <script type="text/javascript">
Load multiple content blocks from another page without specifying ID
I'm loading content from one page into another via the jquery .load event. I'm currently doing it like this: $('#someDiv').load('/directory/file.html #someDiv'); However I have multiple content blocks to load from the same page, so It would be better if I didn't have to specify the name of the div every time. Since they are the same on both pages, is there a way to say, "find a div on page1 and load its content into the matching div on page2? The idea is to not have to update the script every time
delegated live event
table rows with checkboxes get built in AJAX so I need to delegate a live function for the change event. When the toggle-all checkbox in main div is checked all the checkboxes in the table rows get checked. Toggle-all checkbox working. The problem is when there is only one row with checkbox, not checked and it changes and gets checked, then the toggle-all checkbox should get checked. Similarly when all of the checkboxes in the rows are checked and one is unchecked, the toggle-all checkbox should
Background image first preload then fadein?
Hi everyone, When I go to my website I want it to first load the background image fully and not show yet, ones done fully loading I just want it to fade in slowly. I tried something like this: $(".background").load(function(e){ $(".background").fadeIn(1000); }); And I tried something like this: $('.achtergrond', this).fadeIn("slow"); Both in document ready function. The HTML I'm using is: <div align="center"><img class="background" src="images/background.jpg"></div> The CSS I'm using
selecting even/odd elements....
$('#wrapper> .inner:nth-child(even)').addClass('td-even '); this is not working for me, b/c there are other children of "#wrapper that do not have class 'inner'... so how can I do this so it selects only the even elements that have class "inner"?? (I thought that's what this code did..... ;-) (can't post url, don't have access to FTP at work.. but question is simple that I hope I don't have to....;-) thank you....
set z-index automatically
I try to make "Send to Back" as you can see all programs (like PowerPoint,Photoshop). when i click one of "div" it is set zindex=1. But need to change other divs set automaticaly z-index=2 and z-index=3. Is there any body want to help me? thanks http://jsfiddle.net/lansas/Xf3pQ/3/
How do I pass a event argument from a click event?
I have an ordinary javascript function: function point_it(event) { pos_x = event.offsetX ? (event.offsetX) : event.pageX - document.getElementById("Chart1").offsetLeft; pos_y = event.offsetY ? (event.offsetY) : event.pageY - document.getElementById("Chart1").offsetTop; } The purpose is to get the x-coordinate and the y-coordinate of a mouse click. But how do I call it? The following does not work: $("#Chart1").click(point_it(event)); Thanks
Help, need get attribute name from current function
Hello, i need help with getting the name of an attribute. for example, i have this code: <script src="http://code.jquery.com/jquery-latest.js"></script> <a href="#" ShowAlert="Anything">Click To Show Attribute Name</a> <script> $('[ShowAlert]').bind('click',function(){ var ThisAttrName = $(this).attr('ShowAlert'); // I dont know how to get this Attribute name "ShowAlert" alert(ThisAttrName); // Show This Attribute Name "ShowAlert" }); </script> it shows
Need a patch for this site
Hi everyone I recently purchased a templete in themeforest, but we have realized there is a bug with the jquery menu. The developers won't reply my emails, and I need help to fix the bug. The problem is: Some content in the main frame overlaps the jquery menu when seen in Chrome and Firefox. At first we thought we missed some code when we transfered the files, but we discovered they have the same problem in their live demo. Here is the site. Just roll over the content while highlighting submenu items,
Converting top menu into the select box when resizing browser's window
Hi all, I have written a simple jQuery code that uses a plugin to convert menu into a simple select box when the menu can't fit into the container. It works fine, but I would like to make it execute in "real time", when user manually resizes the browser's window. Now, if you want to see the effect, you must resize the window and then click Refresh. Is it possible? jQuery(function () { var topMenuContainerWidth = jQuery("div.cell").has("ul.nav").innerWidth(); var topMenuWidth = jQuery("ul.nav").innerWidth();
jquery chrome and ie
When click yourBtn, the functions work but not till the end at IE? Chrome is OK!! Where exactly I am wrong? <input type="button" class='butons_hello_divekle' name="yourBtn" id="yourBtn" onclick="getFile()"/> function getFile(){ $("#upimgfile").click(); } function sub(obj){ var file = obj.value; var fileName = file.split("\\"); alert(fileName.length); alert(fileName); alert(fileName[fileName.length-1]); //it works till this line at IE $("#yourBtn").html(fileName[fileName.length-1]);
fixing button code Toggle
when i am enter on the button Toggle it is open to me the both of the buttons | code: <style> p { background:#dad; font-weight:bold; font-size:17px; } </style> <script src="http://code.jquery.com/jquery-latest.js"> </script> <div align="center"> </div> <div align="center"> </div> <div align="center"> </div> <div align="center"> <button style="width: 651px; height: 42px;"> <div align="center"> <font size="6"> "בסיס - "על המערכת </font> </div> </button> </div> <div>
How to change alternate row color when we have multiple nested table.
Hi guys, I have a html table having class name "visiblerow" and "hiddenrow" in hidden row i am using display:none style sheet and for visible row display:block style sheet. Now when i am trying to applied alternate color by using these code then its not working.I have observed that due to using asp:panel its creating the problem to evaluate the even and odd row. Since asp:panel is visible true and false at server side and i have to do this functionality at client side. Please advise how to resolve
Id selector not working
I have the following navigation layout: The outer <dl> is rendered in one file, the inner <ol> in another I am using php to determine how many <li>s are in each <ol>. If there are more than 6, I add a class "hidden" to each <li> after the 6th and display a "Show All" Link after the last visible <li>. Hitting this link will run some jQuery to remove the hidden class from the <li>s, displaying the full <ol>. While this is generally working, my problem is, that clicking the "Show All" link in let's
Ajax rating control
how to get and set value in ajax rating control in jquery . please any one help me
how to do two buttons in toggle
i want to double the code for there will be two buttons and every button do the same thing <style> p { background:#dad; font-weight:bold; font-size:17px; } </style> <script src="http://code.jquery.com/jquery-latest.js"> </script> <div align="center"> </div> <div align="center"> </div> <div align="center"> </div> <div align="center"> <button style="width: 651px; height: 42px;"> <div align="center"> <font size="6"> "blablabla </font>
Ajax Rating Control
sir asp.net page adding ajax rating control.. i want style design and value retrieve assign in ajax rating control using j query. please any one help me.
problem in code
how can i make this code for it will work (without change any detail from the code): <style> p { background:#dad; font-weight:bold; font-size:17px; } </style> <script src="http://code.jquery.com/jquery-latest.js"> </script> <div align="center"> </div> <div align="center"> </div> <div align="center"> </div> <div align="center"> <button style="width: 651px; height: 42px;"> <div align="center"> <font size="6"> "blablabla </font>
JQuery( i think ) - is this possible
Sorry not really sure on how to topic this but i'm wanting to do the following. 1.) User clicks link on front page 2.) it takes them to another page and depending on the link clicked on the front page expands the appropriate JQuery accordion control from the corresponding link clicked on the front page? Note: Currently using ASP.NET
Is it possible to create a Tooltip with formatted text inside?
Hey guys, I'm using a Tooltip to show more details on products in my website so i needed it to display formatted text, like for example a bigger text with the name of the product and then a small one below, describing it. Is it possible to do so? Thanks in advance!
make the button in the center
i want to do for the button in the Toggle will be in the center i need do know where i put the <center>
validating one textbox only with jquery ui
I have the following textbox: <input id="txtEmailMe" class="required email" type="text" style="width:200px;" name="ctl00$BannerHolder$txtEmailMe"> I then have: $('#emailMeSend').click(function (evt) { //firs need to check if valid email evt.preventDefault(); On my button click which is working fine I want to check to see if this one textbox is valid. I have opened a form up on a jquery ui dialog which has one textbox, the one you see above. How can I validat this textbox only
how can i do for the out put in the button will not show when i open the page
how can i do for the out put in the button will not show when i open the page every code for i open it showing me first the output and then when i click it is disappear i am talking about ToggleSlide like this code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <style> p { background:#dad; font-weight:bold; font-size:16px; } </style> <script src="http://code.jquery.com/jquery-latest.js"></script> </head> <body> <button>Toggle
jquery pair/not pair tag
Hello, I would like to create xml document using jquery, everything works fine, but I need to use image and track tags and these tags need to pair, however jquery creates them as not pair tags. Is there some workaround for that or it is not possible to do it? Thanks
Simplify my Code please
Hi Guys, I am new to this forum. And as I am not very experienced in working with jQuery I have a maybe stupid question: So I have multiple checkboxes on my page each one has a unique id. some of them also have a class called show-more if i click a checkbox with class show-more a fieldset with the class name that is equal to the id of checkbox with class show-more is shown (second class of fieldset is "field") so my code looks like that: First I check all the id if they are checked (only the one
Login form without reloading
Hello everyone, I have little a problem with set up my login form with jQuery functions. My login form is in PHP of course, it's very simple, it has only one input to write proper password - after that user can see "hide section". I want to use jQuery to make this form free of any reloading, for example when user puts wrong password. Ok, here is my script, I have just set up in jQuery "error message" with fade effect, but after submit button page is reloading (and that is what I can't do it). How
Filtering the div containing some text
I have some ten to twenty number of <li> tags which contains divs as shown below. Now i want to filter <li> tag that contains div which has id final review and div that has the class ui-block-b Inprogress. how to do this. <li data-theme="c" style="border-bottom:#000 1px solid; line-height:22px;"> <div> </div> <div class="ui-grid-b"> <div class="ui-block-a">Initial Evaluation</div> <div class="ui-block-b"> </div>
Type in span/div respecting breakline and then transform to pre
Hello. I'm facing a situation here (studying purpose) where I type in a textarea and onkeyup it will copy the text to a span or div and after it, it will turn the component into a pre to use syntaxhighlighter. I found out that I can change the breakline by replacing the text breakline (/\n/g,'
') i can change the modifier to break it, but if I add <br/> there, the syntaxhighlighter will show the <br/> and not jump to the next line. I tried with text() and html(), and after render it in the
refresh on ipad rotate ?
hello. i have a simple fade effect for ipad . is it possible to make the image disapear and fade in again if the ipad is rotated from landscape to portrait or vice versa ? also, how would i make a fade repeat in and out constantly this is my code. $(function(){ $('.logo img, .tag1 img, .tag2 img').hide(); $('.logo img').each(function(i) { if (this.complete) { $(this).delay(500).fadeIn(3000); } else { $(this).load(function() { $(this).delay(500).fadeIn(3000);
I want upon unload detect the destinated url (how, this the problem)
$(window).unload(function(){ alert("Goodbye1!"); if (window.location.indexOf("localhost/freelancerHelp/divsMoveShowPCH/")==-1) { alert("Goodbye2!"); } }); // I want upon unload detect the destinated url (how, this the problem?) and appear a message only if not in my site the future url... how?
Jquey - How to execute a a function only when ajax request is complete and all content is alread loaded
I have this 2 functions to be execute but I want the second to be executed only when the content of the first request is already loaded in the DOM element.. general function that loads ajax content: function ajaxDialog(AjaxUrl, type, targedDom, dialogedDom, tabs) { $.ajax({ url: AjaxUrl, type: type, DataType: "html", success: function (data) { //puts data inside targedDom Dom elemen $('#' + targedDom).html(data); //create tabs loadDialogSettings(dialogedDom, tabs); } }); } this first function creates
.parents() only travelling up 2 ancestors
Hi, I am using the .parents() function to find a parent element that is up 3 levels. .parents() stops at level 2 and never returns the 3rd. <div class="ajax_container"> <div id="ajax_wrapper"> <nav> <a class="next">Click</a> </nav> </div> </div>Binding a click event to '.next' that gets all the element's parents, I get "nav, div#ajax_wrapper", and that's it. wtf? Paddelboot
.ajax, no preflight message and error on 200 OK
I'm trying to test out a new web service and it seems to be working fine except when I consume it using jQuery. jQuery.ajax first of all isn't sending an OPTIONS request, just a GET request, even though it is cross-domain, and then when the response comes back 200 OK with an XML response jQuery.ajax throws an error, responseText is empty and responseXML is undefined. Here's my code: var name = prompt("Please enter your name", "Harry Potter"); var XmlUrl = "http://c12723/HostDevServer/HelloWorldService.svc/GetMessage?name="
Naming Conventions for using jQuery class selectors (Is there a convention)
I'm a .Net programmer and am starting to use jQuery more and more. I'm wondering how I should approach naming jQuery classes that are mixed in with CSS classes. For instance, let's say I have the following textbox. <asp:TextBox ID="txtSubject" CssClass="textField officeName" MaxLength="150" runat="server" /> In this case, textField is a CSS class that is formatting the textbox and officeName is a jQuery class that I am using to populate the field after some jQuery is run. Should I name my jQuery
Does anyone know if this is even possible
I'm trying to create draggable div that sits inside of a containing div. This is all working correctly and it is properly contained. What I really want to do is make is so that if you drag it off one edge of its container, it reappears from the other side. I've attached a diagram to clarify this. Any direction would be greatly appreaciated. Thanks! SR
jQuery 1.8.2 - Animation flashing
Hey, I'm making a simple project slider and I'm facing some flashing issue when animating the elements. I'm also using requestInterval / requestAnimFrame / clearRequestInterval for smoother animations but it still happened when using regular setTimeout function. You can test it at http://labs.danimt.net/dani/ on the bottom portfolio slider with controls on the right.
[SOLVED] Script doesn't work since jQuery 1.6
Hello, I would like to update my website by using the newest jQuery (1.8.3). The code below works with jQuery before 1.6. Could you please help me to update my code ? jQuery.noConflict(); jQuery(document).ready(function($) { $('[class^=toggle]').hide(); $('[class^=link]').click(function() { var $this = $(this); var x = $this.attr("className"); $('.toggle-' + x).toggle(400); return false; }); });Thank you in advance.
Jquery Menu Affect
Hi guys, I need a menu hover affect for a few of my sites, but like when the mouse hovers... i want the button to change colour but with an effect on it too. Anyone know anywhere i can find this? Cheers, Sam
How to Close Fancybox from an Iframe
i use fancybox in i frame.i have button in iframe and after click that button close fancy box. bellow code is not working. $.fancybox.close(); and also i used like this.bellow code is not working also. parent.$.fancybox.close(); i need to close fancy box and then scroll down parent page. Anyone can help me to fiexd this issue. Thank you,
Next Page