Search Results

Search found 63 results on 3 pages for 'ajaxform'.

Page 1/3 | 1 2 3  | Next Page >

  • Jquery Ajaxform with input type=file and multifile

    - by crunchingnumbers
    Im using ajax form with multifile. However ajaxform just seems to quietly die and does not do anything if using multifile. Multifile is just a jquery plugin that builds a list of input type=file so that you can upload multiple files at once, before which you can add/delete your file upload list. I've looked at multifile and made one change to ensure that it generated a unique name as well as id which it didn't do before and i've checked the form elements multifile is building which all appear to be correct. From looking at ajaxform, it seems that it shoulld just generate the iframe as normal and post the multiple input type=file but it does nothing. Has anyone else experienced problems with multiple input type=file uploads

    Read the article

  • jQuery ajaxForm returning .json file

    - by Lowgain
    I've got a model creation form in rails which I also have returning JSON through ajax. My code so far look like: $('#new_stem').ajaxForm({ //#new_stem is my form dataType: 'json', success: formSuccess }); function formSuccess(stemObj) { //does stuff with stemObj } And I have a multipart form with a file uploader (but I'm not sure if that is relevant). When I submit the form it works fine (my models are properly being created and renders as json), but instead of the json getting handled by the formSuccess function, it prompts a download for "stems.json" (the path to my stem creation action) in Firefox. What would cause this to happen, and what could solve it? Not sure if this is part of the problem, but I don't have a submit button in my form, I have a link with a click handler that calls $('#new_stem).submit() Thanks guys!

    Read the article

  • Re-binding an ajaxForm after content re-loads with ajax (jQuery 1.4.2)

    - by Cristian
    I'm trying to figure out why this is a problem when using jQuery 1.4.2 and not 1.3.2. This is my function: function prepare_logo_upload() { $("#logo-upload-form").ajaxForm({ //alert(responseText); success: function(responseText) { //alert(responseText); $('#profile .wrapper').html(responseText); prepare_logo_upload(); } }); } Every other live event works but can't use the .live() method because ajaxForm is a plugin. I have noticed this also for other types of binding (clicks) using the old form (re-binding after callback) Can you tell me if it is a way of solving this? This is a similar question, but due to my newbie reputation here, can't comment or ask a question there, so I'll ask a new one here. - http://stackoverflow.com/questions/2208880/jquery-bind-ajaxform-to-a-form-on-a-page-loaded-via-load Thank you!

    Read the article

  • How do I submit a form using jquery (ajaxForm plugin) to an external site but not reload to a differ

    - by Scott
    Hi, I'm trying to create a form that sends the customer's name and email address to icontact (an email list application). All the values are correct for icontact and if I submit the form as usual, icontact responds that it added the email address. The success message loads in a new page from icontact's website. What I'd like to accomplish is that ajax would send the form and returns a success message within the current page, without sending the customer to a new page. Here is the test page: http://www.skhot.com/test/js-test/forms/index.php

    Read the article

  • $ajaxForm reply back from processing page using jquery and php

    - by Jean
    Hello, I have a page called guestbook.php in which contains $('#guest_form').ajaxForm({}); When the form is triggered it goes to a save.php page which contains and values inserted if($_POST['x']){ $xx = $_POST['x']; $yy = $_POST['y']; $zz = $_POST['z']; $query_one = "INSERT INTO xxx (x1,yl,z1,z2) values ('$xx','$yy','$zz','00000')"; mysql_select_db($database_1, $1); $Result = mysql_query($query_guest_one, $1) or die(mysql_error()); So far so good. Now I run a select query based on the insert and display it in a div on the guestbook.php page. That is where I cannot do it. All help appreciated. Thanks Jean

    Read the article

  • jQuery ajaxForm "h is undefined" problem

    - by Simon
    I have a form that is brought up in a ajaxed modal which I am using for updating user details. When the modal loads I call a js function: teamCreate: function() { $j("#step1,form#createEditTeam").show(); $j("#step2").hide(); var options = { type: "get", dataType: 'json', beforeSubmit: before, // pre-submit callback success: success // post-submit callback }; $j("form#createEditTeam").ajaxForm(options); function before(formData, jqForm, options){ var valid = $j("form#createEditTeam").valid(); if (valid === true) { $j(".blockMsg").block({ message: $j('#panelLoader') }); return true; // submit the form } else { $j("form#createEditTeam").validate(); return false; // prevent form from submitting } }; function success(data){ if (data.status == "success") { $j(".blockMsg").unblock(); } else { // } }; function error(xhr, ajaxOptions, thrownError){ alert("Error code: " + xhr.statusText); }; } This works just fine when I first submit the form, regardless how many times the modal is opened and closed. However, if I submit the form and then open the modal again and try to submit the form again I get a js error: h is undefined

    Read the article

  • Submitting AjaxForm with jQuery in ASP.NET MVC

    - by Hadi Eskandari
    I have an ajax form in asp.net mvc which is as simple as this: <% using (this.Ajax.BeginForm("LatestBlogPosts", "Blog", null, new AjaxOptions { UpdateTargetId = "blogPostPanel" }, new { id = "BlogPostForm" })) { %> <div class="panel" id="blogPostPanel"> <img src="/images/ajax-loader.gif" alt="ajax-loader" /> </div> <% } %> I want to invoke the form submit when document is loaded. This should supposedly, call the controller's action and return a result that should be replaced with the placeholder DIV. If I add a SUBMIT button to the form, it works perfectly, but when I invoke the submit via jQuery, the whole page is refreshed, and the content returned by the server is displayed in the newly displayed page. Here's my jQuery code: <script type="text/javascript"> $(document).ready(function() { $("#BlogPostForm").submit(); }); </script> Anyway to do this?

    Read the article

  • jQuery sequence and function call problem

    - by Jonas
    Hi everyone, I'm very new to jquery and programming in general but I'm still trying to achieve something here. I use Fullcalendar to allow the users of my web application to insert an event in the database. The click on a day, view changes to agendaDay, then on a time of the day, and a dialog popup opens with a form. I am trying to combine validate (pre-jquery.1.4), jquery.form to post the form without page refresh The script calendar.php, included in several pages, defines the fullcalendar object and displays it in a div: $(document).ready(function() { function EventLoad() { $("#addEvent").validate({ rules: { calendar_title: "required", calendar_url: { required: false, maxlength: 100, url: true } }, messages: { calendar_title: "Title required", calendar_url: "Invalid URL format" }, success: function() { $('#addEvent').submit(function() { var options = { success: function() { $('#eventDialog').dialog('close'); $('#calendar').fullCalendar( 'refetchEvents' ); } }; // submit the form $(this).ajaxSubmit(options); // return false to prevent normal browser submit and page navigation return false; }); } }); } $('#calendar').fullCalendar({ header: { left: 'prev,next today', center: 'title', right: 'month,agendaWeek,agendaDay' }, theme: true, firstDay: 1, editable: false, events: "json-events.php?list=1&<?php echo $events_list; ?>", <?php if($_GET['page'] == 'home') echo "defaultView: 'agendaWeek',"; ?> eventClick: function(event) { if (event.url) { window.open(event.url); return false; } }, dayClick: function(date, allDay, jsEvent, view) { if (view.name == 'month') { $('#calendar').fullCalendar( 'changeView', 'agendaDay').fullCalendar( 'gotoDate', date ); }else{ if(allDay) { var timeStamp = $.fullCalendar.formatDate( date, 'dddd+dd+MMMM_u'); var $eventDialog = $('<div/>').load("json-events.php?<?php echo $events_list; ?>&new=1&all_day=1&timestamp=" + timeStamp, null, EventLoad).dialog({autoOpen:false,draggable: false, width: 675, modal:true, position:['center',202], resizable: false, title:'Add an Event'}); $eventDialog.dialog('open').attr('id','eventDialog'); } else { var timeStamp = $.fullCalendar.formatDate( date, 'dddd+dd+MMMM_u'); var $eventDialog = $('<div/>').load("json-events.php?<?php echo $events_list; ?>&new=1&all_day=0&timestamp=" + timeStamp, null, EventLoad).dialog({autoOpen:false,draggable: false, width: 675, modal:true, position:['center',202], resizable: false, title:'Add an Event'}); $eventDialog.dialog('open').attr('id','eventDialog');; } } } }); }); The script json-events.php contains the form and also the code to process the data from the submitted form. What happens when I test the whole thing: - first user click on a day, then time of day. Popup opens with time and date indicated on the form. When user submits the form, dialog closes and calendar refreshes its events.... and the event added by the user appears several times (from 4 to up to 11 times!). The form has been processed several times by the receiving php script?! - second user click, the popup opens, user submit empty form. Form is submitted (validate function not triggered) and user redirected to empty page json-events.php (ajaxForm not triggered either) Obviously, my code is wrong (and dirty as well, sorry). Why is the submitted form, submitted several time to receiving script and why is the javascript function EventLoad triggered only once ? Thank you very much for you help. This problem is killing me !

    Read the article

  • sending parameters with ajax

    - by kawtousse
    I am trying to send parameters that I get from a table in my jsp to other JSP using ajax. I am using the followinf function to send all values to JSP: ajaxForm but I don't know why the send failed every time I run it: Here is the javascript function: function editarow() { var xhr = getXhr(); xhr.onreadystatechange = function() { if (xhr.readyState == 4 && xhr.status == 200) { selects = xhr.responseText; // On se sert de innerHTML pour rajouter les options a la liste document.getElementById('prjsel').innerHTML = selects; } }; var row, firstNameCell, lastNameCell; var table = document.getElementById("sheet"); var buttons = table.getElementsByTagName("button"); for (var i = 0; i < buttons.length; i++) { if (buttons[i].name == "edit") { buttons[i].onclick = function() { row = this.parentNode.parentNode; // The first name cell is the first child NameCell1 = findElement(row.firstChild); NameCell2 = findElement(NameCell1.nextSibling); NameCell3 = findElement(NameCell2.nextSibling); NameCell4 = findElement(NameCell3.nextSibling); NameCell5 = findElement(NameCell4.nextSibling); NameCell6 = findElement(NameCell5.nextSibling); NameCell7 = findElement(NameCell6.nextSibling); // `innerHTML` pour obtenir la valeur /*alert("name 1 is " + NameCell1.innerHTML); alert("name 2 is " + NameCell2.innerHTML); alert("name 3 is " + NameCell3.innerHTML); alert("name 4 is " + NameCell4.innerHTML); alert("name 5 is " + NameCell5.innerHTML); alert("name 6 is " + NameCell6.innerHTML); alert("name 7 is " + NameCell7.innerHTML);*/ } } } xhr.open("POST", "ajaxForm.jsp", true); xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xhr.send("NameCell1="+NameCell1,"NameCell2="+NameCell2,"NameCell3="+NameCell3,"NameCell4="+NameCell4,"NameCell5="+NameCell5,"NameCell6="+NameCell6,"NameCell7="+NameCell7 ); } After I get the value from the table I want to send all of them to the ajaxForm.jsp.

    Read the article

  • jquery form extension ajax

    - by Craig Wilson
    http://www.malsup.com/jquery/form/#html I have multiple forms on a single page. They all use the same class "myForm". Using the above extension I can get them to successfully process and POST to ajax-process.php <script> // wait for the DOM to be loaded $(document).ready(function() { // bind 'myForm' and provide a simple callback function $('.myForm').ajaxForm(function() { alert("Thank you for your comment!"); }); }); </script> I'm having an issue however with the response. I need to get the comment that the user submitted to be displayed in the respective div that it was submitted from. I can either set this as a hidden field in the form, or as text in the ajax-process.php file. I can't work out how to get the response from ajax-process.php into something I can work with in the script, if I run the following it appends to all the forms (obviously). The only way I can think to do it is to repeat the script using individual DIV ID's instead of a single class. However there must be a way of updating the div that the ajax-process.php returns! // prepare the form when the DOM is ready $(document).ready(function() { // bind form using ajaxForm $('.myForm').ajaxForm({ // target identifies the element(s) to update with the server response target: '.myDiv', // success identifies the function to invoke when the server response // has been received; here we apply a fade-in effect to the new content success: function() { $('.myDiv').fadeIn('slow'); } }); }); Any suggestions?!

    Read the article

  • Using Jquery.Form Plugin + MultiFile to automatically upload a single file

    - by Alan Neal
    I wanted to find a way to upload a single file*, in the background, have it start automatically after file selection, and not require a flash uploader, so I am trying to use two great mechanisms (jQuery.Form and JQuery MultiFile) together. I haven't succeeded, but I'm pretty sure it's because I'm missing something fundamental. Just using MultiFile, I define the form as follows... <form id="photoForm" action="image.php" method="post" enctype="multipart/form-data"> The file input button is defined as... <input id="photoButton" "name="sourceFile" class="photoButton max-1 accept-jpg" type="file"> And the Javascript is... $('#photoButton').MultiFile({ afterFileSelect: function(){ document.getElementById("photoForm").submit(); } }); This works perfectly. As soon as the user selects a single file, MultiFile submits the form to the server. If instead of using MultiFile, as shown above, let's say I include a Submit button along with the JQuery Form plugin defined as follows... var options = { success: respondToUpload }; $('#photoForm').ajaxForm(options); ... this also works perfectly. When the Submit button is clicked, the form is uploaded in the background. What I don't know how to do is get these two to work together. If I use Javascript to submit the form (as shown in the MultiFile example above), the form is submitted but the JQuery.Form function is not called, so the form does not get submitted in the background. I thought that maybe I needed to change the form registration as follows... $('#photoForm').submit(function() { $('#photoForm').ajaxForm(options); }); ...but that didn't solve the problem. The same is true when I tried .ajaxSubmit instead of .ajaxForm. What am I missing? BTW: I know it might sound strange to use MultiFile for single-file uploads, but the idea is that the number of files will be dynamic based on the user's account. So, I'm starting with one but the number changes depending on conditions.

    Read the article

  • How to use the context variable in ajaxSetup with jquery

    - by user1730491
    I have multiple forms on one page and i am submitting them via Ajaxform plugin like this <td> <form> form1 </form> </td> <td> <form> form2 </form> </td> var options = { target: '.ajaxMessage', dataType: 'json', // pre-submit callback success: function(data, statusText, xhr, form){ myResponse(data,form)}, context: { element: this}, cache: false, delegation: true, type: 'POST' }; $(".rform").ajaxForm(options); In mY AjaxSetup , i have this beforeSend:function(xhr, settings){ $this = settings.context.element; alert($this); But its not working , alert says window object

    Read the article

  • Check Avaibility of a page before loading using jquery/ajax

    - by overcomer
    Is it possible check the Accessibility of a page before loading it? I have a form, running on mobile device using wireless connection. The problem is: not always this connection is avaible and i would like to alert the user when is doing a submit or an unload of the page. The problem is that the page contains elements doing redirect like this: <input type="button" value="MyText" onClick="script1;script2;...window.location='mylocation" /> If the user click on this button and the server is not achievable, i will recive some undesiderable errors. Also if I want to generalize my script i do not know the value of "mylocation" previously. The page contains elements to submit the Form also: <input type="submit" name="SUBMIT" value="MyValue" onClick="return eval('validationForm()')" /> For the submitting I'm using the ajaxForm plugin and it works quite well. This is a snippet of code: Thanks to your answer I found the solution to the problem. That's the code: function checkConnection(u,s){ $.ajax({ url:u, cache:false, timeout:3000, error: function(jqXHR, textStatus) { alert("Request failed: " + textStatus ); }, success: function() { eval(s); } }); } $(document).ready(function() { // part of the function that checks buttons with redirect // for any input that contain a redirect on onClick attribute ("window.locarion=") $("input[type=button]").each(function(){ var script = $(this).attr("onClick"); var url = ""; var position = script.indexOf("window.location") ; if (position >= 0) { // case of redirect url = script.substring(position+17, script.lenght); url = url.split("\'")[0]; url = "\'"+url+"\'"; // that's my url script = "\""+script+"\""; // that's the complete script $(this).attr("onClick","checkConnection("+url+","+script+")"); } }); // part of the function that checks the submit buttons (using ajaxForm plugin) var is_error = false; var options = { error: function() { if (alert("Error Message")==true) { } is_error = true; }, target: window.document, replaceTarget: is_error, timeout: 3000 }; $("#myForm").ajaxForm(options); }); I hope that this will be usefull.

    Read the article

  • asp.net mvc ajax form helper/post additional data

    - by Jopache
    I would like to use the ajax helper to create ajax requests that send additional, dynamic data with the post (for example, get the last element with class = blogCommentDateTime and send the value of that last one to the controller which will return only blog comments after it). I have successfully done so with the help of jQuery Form plugin like so: $(document).ready(function () { $("#addCommentForm").submit(function () { var lastCommentDate = $(".CommentDateHidden:last").val(); var lastCommentData = { lastCommentDateTicks: lastCommentDate }; var formSubmitParams = { data: lastCommentData, success: AddCommentResponseHandler } $("#addCommentForm").ajaxSubmit(formSubmitParams); return false; }); This form was created with html.beginform() method. I am wondering if there is an easy way to do this using the ajax.beginform() helper? When I try to use the same code but replace html.beginform() with ajax.beginform(), when i try to submit the form, I am issuing 2 posts (which is understandable, one being taken care of by the helper, the other one by me with the JS above. I can't create 2 requests, so this option is out) I tried getting rid of the return false and changing ajaxSubmit() to ajaxForm() so that it would only "prepare" the form, and this leads in only one post, but it does not include the extra parameter that I defined, so this is worthless as well. I then tried keeping the ajaxForm() but calling that whenever the submit button on the form gets clicked rather than when the form gets submitted (I guess this is almost the same thing) and that results in 2 posts also. The biggest reason I am asking this question is that I have run in to some issues with the javascript above and using mvc validation provided by the mvc framework (which i will set up another question for) and would like to know this so I can dive further in to my validation issue.

    Read the article

  • asp.net mvc ajax helper/post additional data w/o jquery.

    - by Jopache
    I would like to use the ajax helper to create ajax requests that send additional, dynamic data with the post (for example, get the last element with class = blogCommentDateTime and send the value of that last one to the controller which will return only blog comments after it). I have successfully done so with the help of jQuery Form plugin like so: $(document).ready(function () { $("#addCommentForm").submit(function () { var lastCommentDate = $(".CommentDateHidden:last").val(); var lastCommentData = { lastCommentDateTicks: lastCommentDate }; var formSubmitParams = { data: lastCommentData, success: AddCommentResponseHandler } $("#addCommentForm").ajaxSubmit(formSubmitParams); return false; }); This form was created with html.beginform() method. I am wondering if there is an easy way to do this using the ajax.beginform() helper? When I try to use the same code but replace html.beginform() with ajax.beginform(), when i try to submit the form, I am issuing 2 posts (which is understandable, one being taken care of by the helper, the other one by me with the JS above. I can't create 2 requests, so this option is out) I tried getting rid of the return false and changing ajaxSubmit() to ajaxForm() so that it would only "prepare" the form, and this leads in only one post, but it does not include the extra parameter that I defined, so this is worthless as well. I then tried keeping the ajaxForm() but calling that whenever the submit button on the form gets clicked rather than when the form gets submitted (I guess this is almost the same thing) and that results in 2 posts also. The biggest reason I am asking this question is that I have run in to some issues with the javascript above and using mvc validation provided by the mvc framework (which i will set up another question for) and would like to know this so I can dive further in to my validation issue.

    Read the article

  • Jquery Insert HTML

    - by danit
    I'm using: http://jquery.malsup.com/form/#getting-started to submit my form, Ajax styleee. However the form submits correctly and the data is sent however the fields on the form continue to have data in them. How can I clear them on submit? Hiding the form and displaying thank you would also be acceptable? $(document).ready(function() { $('#pollform').ajaxForm(function() { $('#pollform').hide(); }); });

    Read the article

  • How to call a javascript function from a servlet?

    - by sunnyj
    I submit a (jsp) form to a Servlet A. Then I handle some logic which would make the submission either a success or a failure. I use jquery's ajaxForm() function to re-direct the user to a different jsp after the Servlet logic is executed. But before this redirection happens I need to show a javascript notification showing whether the submission was successful or not. Can someone tell me how can I do this?

    Read the article

  • Jquery forms plugin problem

    - by Dudul
    I have the following: $(document).ready(function(){ // bind 'myForm' and provide a simple callback function $('#form').ajaxForm(function() { alert("Works!!!"); }); }); The problem is that when I dynamically add the form to the HTML the script is not working. If the form is there from the beginning the form is submitted with Ajax and works as expected. What is the problem here?

    Read the article

  • Reorder inputs before submiting form

    - by Jason
    Is there any way to reorder or manipulate a set of inputs before posting to a script for processing? I'm able to reorder the elements in the DOM no problem, but getting this to happen after the user presses the submit button and before the browser makes the POST is a bit tricky. I'm using the ajaxForm plugin in jQuery. There is a beforeSubmit callback, but this doesn't seem to allow me to reorded the inputs.

    Read the article

  • Send multi message using jquery plugin in multi-row data?

    - by Agus Puryanto
    i use jquery.form to send a form, but in may case below how use this jquery plugin $('#htmlForm').ajaxForm({ target: '#htmlExampleTarget', success: function() { $('#htmlExampleTarget').fadeIn('slow'); $('#htmlForm').hide(); } }); for($i=1;$i<= 10;$i++){ //form $1 form name="form$i" action="blabla.php" input type="text" name="name$i" / input type="text" name="name$i" / input type="submit" name="submit" / }

    Read the article

  • Override default javascript functionality with jQuery

    - by deth4uall
    I am trying to overwrite a JavaScript on change event in the below code with jQuery however I believe that the inline JavaScript is taking priority over the jQuery functionality declared. Essentially I am trying to have an AJAX version of my site which includes an additional JavaScript file. I need this functionality to still work without the additional AJAX version, but I am not sure as to whether I should include it in the main JavaScript file or leave it inline like it is right now. Any suggestions and information regarding them would be greatly appreciated! Thanks! <form action="/cityhall/villages/" method="post" name="submit_village"> <select name="village" onchange="document.submit_village.submit();"> <option value=""></option> </select> </form> I am trying to use the jQuery Form Plugin to submit the posts to the PHP to handle the requests as follows: var bank_load_options = { target: '#content', beforeSubmit: showRequest, success: showResponse }; $('form.get_pages').livequery(function(){ $(this).ajaxForm(bank_load_options); return false; }); I modified the code as following: <form action="/cityhall/villages/" method="post" id="submit_village" name="submit_village"> <select name="village" class="get_pages" rel="submit_village"> <option value=""></option> </select> </form> <script> # main JavaScript $('.get_pages').live('change',function(e){ var submit_page = $(this).attr('rel'); $("#"+submit_page).submit(); }); # ajax JavaScript var bank_load_options = { target: '#content', beforeSubmit: showRequest, success: showResponse }; $('.get_pages').live('change',function(){ var submit_page = $(this).attr('rel'); $("#"+submit_page).ajaxForm(get_pages_load_options); return false; }); </script> However now it only runs every other option when I change it.

    Read the article

  • show div for a set time, then hide it

    - by Patrick
    Im using jquery for various things on my site, but one thing im not sure how to do, is have it show an element, then wait X seconds, and hide the element. $('#form').ajaxForm(function() { $('#cartcontents').fadeOut("fast").load('cart.php').fadeIn("fast"); }); That's the JavaScript that I'm using now. How could I have it (when the form submits) display the div #notice for 5 seconds, then fadeOut?

    Read the article

  • jQuery fadeIn fails with jqQuery form-plugin

    - by VoodooBurger
    I have a message that I want to fadeIn when a form is successfully send. I'm using the jQuery form plugin and the code: $(document).ready(function() { var options = { target: '#output', beforeSubmit: validate, resetForm: true }; $('#holdform').ajaxForm(options); }); The validate function works perfectly so i added this code before it returns true: (...) $('#output').fadeIn('slow'); return true; } This should fadeIn the div I have underneath the form, styled as display: none;. But what happens is that the div fades in and then disappears. Does anyone have an explanation and possibly a solution to fix it? Thank you in advance! The code can be seen in it error-action here: http://gadebold.dk/events/tilmeld/

    Read the article

  • jQuery Form, ASP.NET MVC JSon Result

    - by Stacey
    I'm trying to return a json result from a jQuery Form instance - but it keeps prompting me to download a file instead of displaying it in the window like it is supposed to... $("#ajaxImageForm").ajaxForm({ iframe: true, type: "GET", dataType: "json", beforeSubmit: function() { $("#ajaxImageForm").block({ message: '<img src="/content/images/loader.gif" /> Uploading . . .' }); }, success: function(result) { $("#ajaxImageForm").unblock(); $.growlUI(null, result.message); } }); [AcceptVerbs(HttpVerbs.Post)] public JsonResult Edit(FormCollection collection) { // return Json to the jQuery Form Result return new JsonResult { Data = new { message = string.Format("edited successfully.") } }; }

    Read the article

  • ASP.NET MVC: Is it "wrong" to use HTTP 500 via an AJAX request to return invalid form content?

    - by Daniel Schaffer
    Here's the situation: I've got two partial views. One has a form. What needs to happen is when the form is posted via an AJAX request, if the operation succeeds, the area with the second partial is repopulated with the content. However, if the posted data was invalid, the original partial is repopulated with an error message. I'm using jQuery and the ajaxForm plugin to handle the form posts and responses. Would it be "wrong"/bad coding/wtf-worthy to conditionally use $.html() to replace the content in one area when it's a 200, and a different area if it's a 500? To me, this idea smells, but I'm not sure how else to accomplish the goal.

    Read the article

1 2 3  | Next Page >