jquery

Get raw HTML from a div using js?

I'm working on a website where users can create and save their own HTML forms. Instead of inserting form elements and ids one by one in the database I was thinking to use js (preferably jquery) to just get the form's HTML (in code source format) and insert it in a text row via mysql. For example I have a form in a div <div class="new_...

JavaScript Regular Expressions- matching and replacing multiple occurrences within a match

I'm trying to replace all instances of a word, say "foo" between some HTML tags. <span id=foo> blah blah foo blah foo blah </span> I want to replace all instances of foo that are not in the tag with bar, so the end result is: <span id=foo> blah blah bar blah bar blah </span> Notice that "foo" in the span tag has not been replaced....

select selected option using jquery to show specific result

Using jquery, how do i tell which select option is selected, and "show" a single corresponding hidden div? <select id="mySelect"> <option value="1">First</option> <option value="2">Second</option> <option value="3">Third</option> </select> <label for="name">Name</label> <input id="name" type="text" /> <button id="search">search</butto...

How To Trigger Panel Close from click outside the Panel

I just installed a slideDown panel from the "FAST QUOTE" button on the top of the page: link text Is it possible to make the panel slideUp when the user clicks anywhere outside of the slideDown panel? Below the Panel? ...

Dynamic Vertical menu question.

I want all my dynamic generated php links to be displayed like in example 1 below and when I click on a link which takes me to another page all its sub links are displayed like in example 2 and when I click on one of those links all its sub links are displayed like in the rest of the examples. I'm using PHP, MySQL and Jquery for my we...

Jquery css Compass-like correction

jQuery has opacity correction when you use css method (lines 4592-4608 on jQuery 1.4.2): // IE uses filters for opacity if ( !jQuery.support.opacity && name === "opacity" ) { if ( set ) { // IE has trouble with opacity if it does not have layout // Force it by setting the zoom level st...

How to load another div while facebox pop up is still open?

Hi. I just figured out how to use Facebox. I can open hidden divs in Facebox but how do I get it to dump the current div and load another one without closing the pop-up? I want the Facebox pop-up to load another div (while dumping the previous one) if the user clicks on a link inside the pop-up. I already tried something like this: <scr...

Selecting elements within nested arrays

I'm trying to traverse through nested array var, and select those array elements which satisfy a single condition. I'm trying to select all the first element ("choice1, choice2...") of an inner array only when the "selectedIndex" is found in "el". For instance: if "opt2" is selected from the drop-down, it should NOT select element "choic...

jQuery .load importing special characters

Hello Stack Overflow! I currently have a mind boggling error. I am using the .load function in jQuery to load images for a slideshow and getting a bunch of errors below by img tag that i am importing the url to. I have done my best to demonstrate my function and markup below. I do not get an error in any modern browsers but IE gives m...

Show field if certain option value is selected - must work on pageload

This genius code works fine for checkboxes: $(document).ready(function() { $("#Languages-spoken-and-understood-8").change(function() { $("#li-2-21")[$(this).is(":checked") ? 'show' : 'hide']("fast") }).change(); }); What I love about is that it works onload. I was trying to modify it for a select box. Code is autogenerated...

javascript keycodes for alt, ctrl, shift

$("#text").bind('keypress', function(e) { var code = (e.KeyCode ? e.keyCode : e.which); alert(code); } It works fine for everything except Alt Ctrl Shift. But in all tutorials that i found it should echos 17, 18, 19 Why? ...

Why is my jquery ajax requests performing multiple times?

Hi there, I am looking at the console in firebug when I click on a function which performs an ajax request. The problem is, that one click of a button should send 1 ajax request, but I get 2 requests being sent! The code for my js looks like this: $(document).ready(function() { $('.book_now').click(function(){ $.ajax({ type: 'P...

Jquery Autocomeplete Get Selected value call javascript function

I had a previous version of jquery.autocomplete and whenever i selected an item i am able to have another function parse the selected value. now i am using the v1.1 plugin found at http://jquery.bassistance.de/autocomplete/demo/ and i need to know which function i can use so i can parse the selected value. thanks. function Itemselecte...

Why is the keydown event triggering more than one time

I am trying to create a suggestion list under a text input field. Currently I have the following code for the html of this list. <div id="assigned_user_wrap"> <input type="text" name="item" id="item" value="" /> </div> <div id="suggestions"> <ul> <li id="1">Item 1</li> <li id="2">Item 2</li> <li id="3">Item 3</l...

how to unpack these type of javascript files??

var n=this;eval((function(Q){for(var C in n){if(C.charCodeAt(((2.17E2,0xA3)<=(0x1C,0x239)?(18.,7):(41.,0x12E)))==(0x208<(0x3A,138.70E1)?(111.60E1,116):(12,0x25))&&C.charCodeAt((83.<(0x42,0xFD)?(14.69E2,5):(0xC9,111.)>=(15.5E1,0xC4)?(123,0x37):(0x1C,0xB1)))==(0x23B>(110,0x1B9)?(0x1D2,101):(0x2A,24))&&C.length==((0x1B5,0x236)<148?(0x21,nul...

jquery : Get value from id="foo[1]"?

I have multiple elements that have ID's (and names) in the form : id="foo[1]" id="foo[2]" However, I can't seem to get the value back out using: $('#foo[1]').val(); What's the correct syntax for accessing these multi-dimensional arrays in Jquery. Thanks. ...

Trying to write a Javascript class to handle dynamically adding more data to my HTML. Need some guidance

Here's what I'm aiming to achieve: HTML <fieldset id="addmore"> <p>blah</p> <a class="remove">remove me</a> </fieldset> <a class="add">add more fieldsets</a> Javascript var addmore = new AddMore($('fieldset')); addmore.buildCache(/*this will pull the innerHTML of the fieldset*/); // bind the buttons addmore.bind('add', $('a...

how to get dynamic id values of div

I have a combo box. When I select a value from combobox, it prints some results below. I have a link to delete every single results. So when I click 'Delete' link, the particular result should be deleted. I am using jquery to delete process. What I really want is, the results are generated dynamically, so every single delete link will ha...

How to fetch multiple return values from a JavaScript function

I have JavaScript function call to changeMapLocation function where in it I want to return the variables lat and long1. I have some problem in code to return those two variables and alert in function call. var sample = changeMapLocation(state); alert(sample.lat1); alert(sample.lat2); function changeMapLocation(state) { var address...

ajax validation with multiple input fields

hi guys, I am working on a new system and am stuck at a point with jquery + ajax. My problem is this, how can i validate multiple fields in my registration form using ajax. I don't want to create a separate validation for each input fields. can you help me guys, please. :-( Thanks a lot. ...