jquery

Hide submit button and show image after submit

I want the submit button to disappear after it's clicked and a new layer to show in its place. Here is what I have so far: <div id=uploadform> <form enctype="multipart/form-data" action='' method='POST'> <input type="file" name="imagefile" class=browse> <p><input type='submit' value='Upload' class=uploadsubmit onClick="if($(this).('#l...

How to monitor the changes in the url (Fragment identifier - the anchor portion of a URL )

Hi, I'm making a website that tend to handle all the request in one page (Ajax). so i thought that I could trap every user's click on a link and check IF it's on my website i do something on JavaScript like an ajax request for example, ELSE it would open the link like usual! doing a watch on window.location did not work! and moreover I ...

Submit file upload/form on file selection

I'd like to take my form below, and somehow adjust it to submit the form when the user selects a file. How can I do that? <div id=uploadform style="width:500px;margin-left:auto;margin-right:auto;"> <form enctype="multipart/form-data" action='' method='POST'> <input type="file" name="imagefile" class=browse> <input t...

Script injection - form validation (jquery)

I use several forms on my site to send data to MySQL. Which is the best way / method to validate my form, if I don't want to users send any script to the database through my forms? ...

addID in jQuery?

Is there any selector available to add IDs like there is for adding a class - addClass()? ...

Strip tags using jQuery?

HTML: <table> <tr> <td> <a href="#">link</a> </td> </tr> </table> I want to: FIND 'link' in 'a' and STRIP ALL parent tags except/until 'table'. I know its not the ideal way to do it, but sometimes you just can't modify the markup so it'd be great to know a jquery hack for this. ...

Use jQuery to load a url on change of table with many input fields

I have tabled data in which most of the cells are text inputs or text areas. Each cell is named with the row, then the column such as <input type=text name=4_16> where 4 is the row, underscore the divider, and 16 the column number I have this javascript (using jquery)... $(document).ready(function() { $('#parent').chang...

Find text in element and addClass to Parent

HTML: <table> <tr> <td> <a href="#" class="nav">link</a> <td> </tr> </table> I want to: FIND TEXT 'link' in a.nav and ADD ID "abc" to 'table'. Tried this but it doesn't work: $('table>tbody>tr>td>a.nav:contains("Forum Index")').parents('table').attr('id', 'newID'); (tbody because most browsers add it automatically) ...

Adding CSS Class using JQuery

Hi, Below I have included the jquery code I am using to try to add a css class to the link in the side column that equals the active url, but it's not working, and at some point it did. Thanks in advance for any help you can provide. Link: http://www.liquidcomma.com/portfolio/project/TSF%5FRobot%5FAd/1/ <script type="text/javascript">...

jQuery Grid - Add "Delete" Button

Hello, I am using jqgrid to display a nice grid that is filled over a php script. Now I only see the navigation bar, how can I add a "Delete-Button" to the left of my bar, so the user can select and delete custom entries (and the jqGrid notifies a php script to delete the selection)? I only want a delete button, no "Add" button. Thanks...

jQuery jScrollPane - Scrolling with mouseover event

I am using jScrollPane to scroll a div. Currently the default is to click the up and down arrows to scroll the pane. But, I would like to use mouseover instead. I have looked at the code but it is not entirely obvious how one would do this. Has anyone done this before? Ideas? http://www.kelvinluck.com/assets/jquery/jScrollPane/sc...

jQuery Find not working for :first

I am trying to find some child a elements within a ul parent. But, I need to only find the first a. Here is what I am using $('div.item a').click(function() { $(this).parent().next('ul.subItems').find('a:first').addClass('selected'); }); HTML: <div class="item"><a id="main5830" href="http://www.mysite.com"&gt;Test&lt;/a&gt;&lt;/...

Need some help understanding this js

Hello, I have the following strange looking code in a js file and i need some help in understanding whats going on. What im confused about is why is the whole thing put in paranthesis ?. What does that mean ? (function() { var someobj = window.someobj = []; var parentId = '#wrapper'; $(document).ready(function() { //some code...

jQuery - Know when images are done loading in ajax response

I have a jQuery ajax function that loads some content into a div, some of the content is images. I would like to said until those images which where just loaded in my ajax, are finished loading, and THEN run a function, such as showing the content. This way, I won't have the content loaded into the div and the images start loading. I ...

Gallery w/ jquery, json, and prev/next buttons. If the json request returns undefined, the gallery breaks.

I'm a beginning coder, learned CSS, HTML, and Jquery in an internship this summer. My boss wants me to create a gallery that has one main image, and then two buttons to display the next or previous item. He wants me to use json, so that they can easily add and remove images. I have it written so that, I start with a variable 0, then when...

Use jQuery to replace form params with a JSON object on submit

How would you code the function replaceFormParamsWithJsonObject(jsonObject)? $('#myForm').submit(replaceFormParamsWithJsonObject(jsonObject)); ...

Adding a script reference into a page using jQuery

Hi, I need to dynamically add a script reference, so I do this: jQuery('html head').append("<script src='somesource.com/somejs.js'><\/script>") and it does't work - I don't get any errors but I can't execute any of the methods defined inside that script. Any ideas what I am doing wrong? Thanks! Andrey ...

Tabs jquery without jquery UI

Does anyone have any resources about creating your own tab control without using jQuery UI? ...

jQuery fadeOut: working on one page but not another

So this is pretty specific to a website I am working on. I have created my own, very simple jQuery rotator for a showcase / portfolio part of a website I am working on. However on one page the script works and on another page not even a simple fadeOut() seems to work. The two pages are: 1) http://dropyx.jonblower.co.uk 2) http://drop...

how to get an anonymous function to keep the scoping it had originally when called in an event handler

I have a setup where I get some information, in an ajax call, then I immediately use some of that information for another call, and then I populate some fields. The problem is that I am not certain how to create the anonymous function so that it can call this.plantName. Right now the value of this.plantName is undefined. I know that t...