jquery-ajax

jQuery Form plugin ajaxSubmit callback timing

Hi, I have the following code bound to the click event of a button: function submitForm() { var $submitOK = false; $('#form1').ajaxSubmit({ beforeSubmit: function() { $submitOK = $('#form1').valid(); return $submitOK; }, success: function(html, status) { $("#response"...

loading div content from external with jQuery.load into own div

Let's say that I have two html pages that are identically designed, but have different content. I have the same div with the same id on both pages. How do I use jQuery.load (or what do I use) so that the div#conent does not get added into the div#content of the first page. I've tried this: $(document).ready(function(){ $("a#linkHome"...

$(document).ready doesn't work in IE

Hello! In my page there is two links, register and login. The important one now is register. When I click it, it loads a .tpl file using jquery load function. In this tpl file I include a new js file with <script> ofcourse, and it works perfectly in safari, ff, opera and chrome, but of course, Why should it be working in IE? So my que...

sending a charset in the Content-Type header

i use jquery $ajax to post a contact form to my email. but encoding is wrong and i see question marks. i figured i should set the content-type but cant manage to do so. am using asp thx ...

object parameters in Javascript

I'm having a bit of an issue with my javascript object. What I want to do is pass in an id and have it set a variable that is accessible to all of my functions. Here's a small sample of what I have: var myObject = function() { var pageSize = 6; var currentPage = 1; var pagerPagesVisible = 5; var pagerId = '#my-pager'; ...

jquery switch statement and scope issue

I have this working script (i know its incomplete): function rsvpNew(selector,function_url) { $(selector).livequery('click',function(){ var select = $(selector).attr('rel'); var event_id = $(this).parents('ul.event-options').attr('rel'); element = this; switch(select) { case "attending": $.ajax({ type: "P...

Ajax jquery <a> to update database

I have a view_mine_and_others.php file that outputs this html <div class="rec" id="1"> <div class="val">343</div> <a class="change">Change</a> </div> <div class="rec" id="2"> <div class="val">12001</div> <a class="change">Change</a> </div> <div class="rec" id="3"> <div class="val">4233</div> <a class="change">Change</a> </div> I...

Calling on a class with an Ajax request

Currently, I am using my own MVC framework. What I'm trying to do is make an Ajax call with jQuery(got that part down), and call on a method from the controller so that I can pass the get variables to it and get the output I want returned from the Ajax call. I can't refresh the page because it is a page full of forms and I don't want ea...

facebox-jquery problem in chrome and safari

Facebox is a jQuery-based, Facebook-style lightbox which can display images, divs, or entire remote pages. But, in Chrome and Safari you'll can have a bad experiencie when displaying post-submit form (the response). test here with Chrome: http://www.freecss.info/tutorial/contact/index.html "submitemail.php" (the response) is displayed...

jQuery $.get problem

Hi, I am a little bit stumped with the following problem and I am afraid that the solution is too obvious but I don't see it anymore. Problem, how come that this jQuery code works: $(document).ready(function() { var q = $(".box").val(); $.get("db.php", {searchterm: "test", type: "search", time: "2pm" }, func...

MVC ActionMethod not finding passed in Value

Hi, I have a Create ActionMethod, something along the lines of: [AcceptVerbs(HttpVerbs.Post)] public ActionMethod Create(Journey journey) { if (Request.IsAjaxRequest()) { //Save values return Json(new { JourneyID = journey.JourneyID } ); } } The Journey object that I pass in is from my LINQ2SQL datamodel. I call the ab...

jQuery Load problem in Internet Explorer

I am having troubles with jQuery's load function and am hoping for some help. I just started testing a site I built in IE to debug/hack/etc to make sure it works. Firefox/safari/etc all work great. .load won't work for me though. It just seems to hang. Would love some help. Here is a simplified version of the problem: <!DOCTYPE HT...

Building value of a variable by looping through form fields

Still a little green when it comes to AJAX/JS, and don't know the specific method(s)/functions(s) I'm looking for to acheive this task. Please bare with me if similar questions have been asked time after time before, and I hope there's enough information here to help you help me find the right answer. Outline I'm currently building a ...

targeting a specific form with serialize()

Following on from my previous question, which was so quickly answered by Meder it wasn't funny, there's now an additional question that's popped up in the process of making a reusable jQuery form submitted that doesn't take the user away from where they were. Problem The jQuery serialize() function is performing its magic on all forms ...

not getting radio button values in jquery ajaxform

Hi, I have a form which is binded to a JQuery Form (AjaxForm) object. In the form I have some radio buttons: <input type="radio" id="dialog_stranka_dodajuredi_tip_fizicna" name="dialog_stranka_dodajuredi_tip" value="2" /> Selection 2 <input type="radio" id="dialog_stranka_dodajuredi_tip_pravna" name="dialog_stranka_dodajuredi_tip" val...

How to get Model errors in AjaxSubmit?

I am using AjaxSubmit to post a form and there are server side validations done using XVal (RuleException way). I am not using the try/catch way to add error to Model and then send to view. Instead - I want to use the HandleError attibute and in the OnException I am adding the errors to Model. The major problem is how do I get those erro...

securing an asp.net web service for use with jquery ajax

Hi, I'm using jquery ajax to fetch data from an asp.net webservice. I'm wondering how I can secure it and have it work with jquery ajax. The service is part of my web application and to access it you have to be logged in to the application. However I'd like to further secure it. For example a consultant looking up all their customer...

jQuery Button not executing onclick

I have a jquery function that loops through an xml and display it in a table and has buttons for each row so user can click on it and delete the record. Like this code I have attached; $('#btnGetRecords').click(function() { $('#imgStatus').show(); $.ajax({ type: 'POST', url: '/WebService1.asmx/GetRecords', ...

What is the proper way to do multi-parameter AJAX form validation with jQuery and ASP.NET MVC?

I have a registration form for a website that needs to check if an email address already exists for a given company id. When the user tabs or clicks out of the email field (blur event), I want jQuery to go off and do an AJAX request so I can then warn the user they need to pick another address. In my controller, I have a method such as ...

jquery live method, how to disable one link and not every link

how can i disable live('click', function...) method and then after ajax call (depending on response), then enable it again? i read some place that "event.preventDefault();" dont work on live method and even if it works, how can i enable it again? i cant use die('click', function...) method, because it will disable all the links and not ...