logo
down
shadow

change id of a form with jQuery but jQuery uses the old attributes to recognize it


change id of a form with jQuery but jQuery uses the old attributes to recognize it

By : user2949799
Date : November 17 2020, 04:28 AM
This might help you Bind occurs on the actual DOM node. So changing a specific property/attribute of it does not change what is bound on it. The only thing you change in the two hanlders is the url, so it would better to just use a single script that selects the url based on a condition
so
code :
$('#onlist').submit(function () {
    var formData = new FormData($('#onlist')[0]),
        actionUrl = $(this).data('action-url');

    $('#res').append("<div id='alertshow' class='alert alert-info'><a href='#' class='close' data-dismiss='alert'>&times;</a><strong></strong>Loading,Please Wait...</div>");

    $.ajax({
        url: actionUrl ,  //Server script to process data, using the dynamic URL we set
        type: 'POST',
        data: formData,
        async: false,
        success: function (msg) {
          $('#res').empty().append(msg);
          $('form input:checked').parents('a').remove();
        },
        cache: false,
        contentType: false,
        processData: false
     });
        return false;
    });
});


$('#sentbox, #inbox').click(function(){
    var url= $(this).data('action-url');

    $('#reload').load('loadsent.php');
    $('.nav li').removeClass('active');
    $('#onlist').data('action-url', url);
    var $parent = $(this).parent();
    if (!$parent.hasClass('active')) {
        $parent.addClass('active');
    }
});


Share : facebook icon twitter icon
JQuery and form attributes change in IE

JQuery and form attributes change in IE


By : Andrew FR-sawerious
Date : March 29 2020, 07:55 AM
this one helps. I want to change form attributes with JQuery. In other browsers it works fine, but not in IE(6,7,8). , Try this
code :
$('#form1').attr("action","/controller/action/id/");
$('#form1').attr("target","upload_iframe");
$('#form1').attr("enctype","multipart/form-data");
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="http://code.jquery.com/jquery-1.4.2.min.js" type="text/javascript"></script>

    <script type="text/javascript">
  $(document).ready(function() {
    $("#btn").click(function() {
     $('#form1').attr("action","/controller/action/id/");
     $('#form1').attr("target","upload_iframe");
     $('#form1').attr("enctype","multipart/form-data");

    });
  });
  </script>

</head>

<body>

<form id="form1" action="something.html" method="post" name="forma" target="target" enctype="nope">

     <a href="#" id="btn">Uno mas</a>  

</form>

</body>
</html>
    action = '/controller/action/id/';
    target = 'upload_iframe';
    enctype = 'multipart/form-data';    

    $('#form1').attr("action",action);
    $('#form1').attr("target",target);
    $('#form1').attr("enctype",enctype);

    console.log($('#form1').attr("action") + " " + $('#form1').attr("target") + " " + $('#form1').attr("enctype"));

alert($('#form1').attr("action") + " " + $('#form1').attr("target") + " " + $('#form1').attr("enctype"));
How to I change the action attribute for a html form on submit with JQuery using the jquery form plugin?

How to I change the action attribute for a html form on submit with JQuery using the jquery form plugin?


By : Thomas H
Date : March 29 2020, 07:55 AM
fixed the issue. Will look into that further Take a look at the documentation for your plugin. The answer is there.
Under options
code :
beforeSubmit: function(arr, $form, options)
Forcing jQuery to recognize certain attributes before a fadeIn()

Forcing jQuery to recognize certain attributes before a fadeIn()


By : Shiva034
Date : March 29 2020, 07:55 AM
seems to work fine If your circles are display: none in your CSS before they're faded in, you're not going to get any position offsets. I would suggest doing opacity: 0 and using .animate({opacity: 1}) instead.
jQuery change all attributes within a form to something else

jQuery change all attributes within a form to something else


By : hloureiro
Date : March 29 2020, 07:55 AM
wish helps you I have a form with form elements such as follows: , You can use:
code :
$(function () {
    $('#EditUserForm [readonly]').prop('readonly', false);
});
jQuery: How to change multiple form attributes before submission

jQuery: How to change multiple form attributes before submission


By : luciano
Date : March 29 2020, 07:55 AM
wish of those help Every form has a submit function attached to it, it's referenced as form.submit.
When you name something inside the form submit it too is attached to the form, and it overwrites the native form.submit so the form can no longer be submitted with the submit function.
Related Posts Related Posts :
  • Build Fails: `npm rebuild node-sass --force`
  • Angular Datepicker change dateformat
  • Trying to extract data from between two sets of characters
  • Configuring Jest in WebStorm
  • Uncaught Error: Syntax error, unrecognized expression: tr.ec_portfolio_title,
  • JQuery fading in fading out continuously
  • Unexpected end of input (Line 1) and Undefined Function?
  • How to animate the width of a div slowly with jquery
  • JavaScript + RegEx Complications- Searching Strings Not Containing SubString
  • SignalR - Unable to get property 'client' of undefined or null reference
  • full calendar not displaying when loaded (with backbone)
  • Angular: Update service and share data between controllers
  • ReplaceAll Google script
  • Search for matching LI items in separate UL
  • Access arguments of an... argument
  • Customizing Google custom search jsapi (query strings)
  • React | Can´t load Images > Module not found
  • Dynamically creating buttons in DOJO
  • 404 Not Found in AJAX post call
  • How do I find out, using javascript, what software opened and running my application?
  • Javascript to check the status of wireless connection
  • StarDict support for JavaScript and a Firefox OS App
  • Phonegap event Resume
  • call javascript function on ENTER key press?
  • When is the best time to remove no-js classes from the html tag
  • Recommended email sending languages
  • setInterval not working properly with chrome
  • Does IE create new scope for each script tag?
  • Uncaught SyntaxError: Unexpected token < Underscore and parse issues
  • How to pass captured URL to Email Body in HTML
  • How to structure default nested resources?
  • Store all the keys of a JSON object in a variable
  • Need an efficient way to group the Array of object in javascript
  • a sensible approach to highcharts x-axis labels
  • IDE autocompletion for javascript AMD loading style
  • Bootstrap menu disappears after first click setting the ul style to none
  • split ajax json response errors in each field
  • how to add javascript in head in cmsms
  • REGEX: Finding the correct occurrence order of some given special characters in a string
  • How do you preserve a JavaScript date's time zone from browser to server, and back?
  • Return binary result from phantomjs webserver
  • must be listed in the web_accessible_resources manifest key in order to be loaded by pages outside the extension.
  • Replacing a substring of an element's text with another string
  • How do I filter marks greater than or equal to 90 in this array?
  • Modify the text of my radio input button?
  • Clicking on status bar does not scroll to top of app (Trigger.io)
  • Mocha JS: How to highlight specific assertion failure?
  • $.getJSON jquery parsing to HTML
  • Find items of a certain class (a) that are also in other classes (b,c,d)
  • Setting different images for D3 force-directed layout nodes
  • Integrating Dropzone.js with angular
  • Control sprite animation speed
  • Can only one error / success function be assigned for AngularJS $http promises?
  • Working with math in javascript
  • Django variable isnt recognized by javascript
  • $.when does not work with $.scrollTo plugin
  • How to read local xml file using $.ajax?
  • Manifest is not Valid JSON. What is wrong?
  • AngularJS re-initialise JS after statechange
  • WebRupee is not working
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org