Showing posts with label JQuery. Show all posts
Showing posts with label JQuery. Show all posts

Thursday, October 18, 2012

JQuery - disable form inputs

$($('#submit_button').parents('form')[0]).find('input,select').each( function () {$(this).attr('disabled', false) });

Friday, August 10, 2012

Attach/add post parameters to form


Add/replace input tag(s) within the form:

function fn_copyFormInputs(sourceFormName, targetFormName, inputNames) {
    for(var i=0; i<inputNames.length; i++){
      $('#' + targetFormName + ' #' + inputNames[i]).remove();
      var value = $('#' + sourceFormName + ' #' + inputNames[i]).val();
      $('<input />').attr('type', 'hidden').attr('name', inputNames[i]).attr('id', inputNames[i]).attr('value', value).appendTo('#' + targetFormName);
    }}

Capture AJAX callbacks

$('#your_form').bind('ajax:error', function{ alert('Ajax failed!')} )

Get form input hash

var params = {}; $.each($('#your_form').serializeArray(), function(i, field) {params[field.name] = field.value;});

Tuesday, December 28, 2010

JQuery - UI

jQuery is a new kind of JavaScript Library.
jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript.

http://jquery.com/