jquery-ajax

C# ASPNET MVC - How do you use ModelState.IsValid in a jquery/ajax postback?

From what I've seen ModelState.IsValid is only calculated by the MVC frame work on a full postback, is that true? I have a jquery postback like so: var url = "/path/to/controller/myaction"; var id = $("#Id").val(); var somedata = $("#somedata").val(); // repeated for every textbox $.post(url, { id: id, somedata: somedata }, function (...

How to read a txt from an Open File dialog and load the content in a textarea with javascript (jquery)?

I want to make an "Open File" button to import txt files contents into a textarea. How can I read the file contents without uploading it to the server? I want to use javascript (with jquery lib) and I want to do it without refreshing the page. ...

jquery ui cannot reload current tab

I need to reload the current tab in jquery ui (loaded with ajax). I'm doing this: function reloadtab(){ $('#tabs').tabs('load', $('#tabs').tabs('option', 'selected')); } Before you begin wondering: $('#tabs').tabs('option', 'selected'); returns 3. When I call reloadtab() I get no error, it simply doesn't work. Why does th...

Think this is a naming problem

Must be really dumb today - sorry in advance; anyhow have this unordered list <ul> <li><div class="openuserform" >Info</div> <div class="userform"></div></li> <li><div class="openuserform" >Appearence</div> <div class="userform"></div></li> <li><div class="openuserform" >Pages</div> <div class="userform"></div></li> <li><div class="open...

jQuery show submit button on input field click

Hi, I'm trying to have a comment input field that will show the submit button on a dynamically created form when you click on the input field. Similar to how facebook comments work. When you click on the input field the submit button appears and when you click off it disappears. All the comment input id's are comment_1 etc and the subm...

ASP .NET: Cannot call Page WebMethod using jQuery

I created a WebMethod in the code-behind file of my page as such: [System.Web.Services.WebMethod()] public static string Test() { return "TEST"; } I created the following HTML page to test it out: <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"/&gt;&lt;/script...

Is this valid data for jquery ajax call to aspnet mvc controller?

I am using jquery with asp.net mvc.... Is my data option valid or am i missing some thing... $.ajax({ type:"POST", url: "Materials/GetRecords", data: "{'currentPage':1,'pageSize':5}", Any suggestion.... EDIT: I am calling a function from a view page, <asp:Content ID="Content2" ContentPlaceHolderI...

ajaxStart() showing loading message doesn't seem to work....

I user jquery.ajax call to controller of asp.net mvc... I would like to show a loading indicator.. I tried this but that doesn't seem to work... <div class="loading" style="padding-left:5px; margin-bottom:5px;display:none;"> Loading...&nbsp </div> and my jquery ajax call looks like this, function getMaterials(currentPage) { ...

jQuery ajax form submit - multiple post/get requests caused when validation fails

Hi, I have a problem where if a form submission (set up to submit via AJAX) fails validation, the next time the form is submitted, it doubles the number of post requests - which is definitely not what I want to happen. I'm using the jQuery ValidationEngine plugin to submit forms and bind validation messages to my fields. This is my code ...

Use jQuery Fancybox(lightbox type dialog) with dynamically loaded links

I'm trying to bind Fancy box links so that when the new links are created it will still work. I've seen a few other question on here but not really answered. This is what I'm trying to do. jQuery("a#[id^='domore_']").fancybox({ 'autoDimensions' : false, 'width' : 'auto', 'height' : 'auto' }); This works fine but whe...

Making a jQuery selection in IE on html added via .load()

Scenario: I am using jQuery to lazy load some html and change the relative href attributes of all the anchors to absolute links. The loading function adds the html in all browsers. The url rewrite function works on the original DOM in all browsers. But In IE7, IE8 I can't run that same function on the new lazy loaded html in the DOM...

Passing an Ajax variable to a Codeigniter function

Hello, I think this is a simple one. I have a Codeigniter function which takes the inputs from a form and inserts them into a database. I want to Ajaxify the process. At the moment the first line of the function gets the id field from the form - I need to change this to get the id field from the Ajax post (which references a hidden ...

How to update strongly typed Html.DropDownList using Jquery

I have a webpage with two radiobuttons and a dropdownlist as follows: <div class="sectionheader">Course <div class="dropdown"><%=Html.DropDownList("CourseSelection", Model.CourseList, new { @class = "dropdown" })%> </div> <div class="radiobuttons"><label><%=Html.RadioButton("CourseType", "Advanced", false )%> Advanced <...

2 ajax forms on the same page

Hi All, Is it possible to have 2 ajax forms on the same page? If so, is it common? Just curious, rodchar ...

2 ajax forms on the same page posting same textbox

Hi All, Is it possible to post, say like a value in a textbox, to 2 different ajax forms that are on the same page? It doesn't have to be at the same time? What I'm trying to do is this: I have a search page that searches for customers and displays them on a paged grid. Users can specify up to 5 parameters (5 textboxes) to narrow the s...

How do I ensure jQuery ajax call does not send a local copy of file?

$.ajax({ type: 'GET', url: "string.txt", cache: false, success: function(str){ alert("Data is: "+ str); } }); In this example, string.txt is sent to the cache (\Temporary Internet Files) How do I ensure that the file is not sent. I do not want copy to be sent. Only a read from the server. Am I missing an option? ...

possible to $.post and get a file download dialog back

Hi All, I'm using jquery's $.post and was wondering if I can use this to get a FileResult back? Not having any success yet? The content is coming back in the callback but not as a file download? Thanks, rodchar ...

JQUERY, Compare two Text Blocks, and then animate only the new text

I have two blocks of text Text Block 1 - Currently displayed on the page: "Ahd Hd ahaSdjdajs dadjs jasd adskadskl1lksad klasd klasd dsa Ahd Hd ahaSdjdajs dadjs jasd adskadskl1lksad klasd klasd dsa Ahd Hd ahaSdjdajs dadjs jasd adskadskl1lksad klasd klasd dsa Ahd Hd ahaSdjdajs dadjs jasd adskadskl1lksad klasd klasd dsa" But now Block 1 o...

Why can't I open a new window on my jquery ajax callback?

to show my problem in a couple examples... THIS WORKS $.post("SomePage.aspx", { name : "value" }, function (data) { alert(data); }, "text"); THIS DOESN'T WORK $.post("SomePage.aspx", { name : "value" }, function (data) { window.open("http://www.google.com"); }, "text"); In the ...

How will a search engine read data from my Ajax-based webapp?

OK, not entirely related to programming, so I'm sorry. But I'd like to know about this: So I've got a webapp. There's one column where a list of results are fetched from the database. When you click one, jQuery fetches the information associated with that result and puts it into the second column - all without a refresh and using Ajax. ...