Grey out screen on form submit until new page load

Add just under the page <body> tag – Normal Add just under the page <body> tag – WordPress (Same but needs the ‘$’ changed to ‘jQuery’ or you get “TypeError: $ is not a function” console errors) Create a style for it For any form submit you want to trigger it use onsubmit If you […]

Read More

Examples of .post

Example 1 jQuery.post( 'play_ajax.php', { 'action' : $( "#add_to_channel_dialog_form" ).dialog('option', 'action'), 'userid' : '12345', 'videoid' : '6789', 'allid' : $("#alliance_id").val() }, function(data, textStatus) { alert(data.message); if(data.status == 1) { $( "#add_to_channel_dialog_form" ).dialog( "close" ); } }, 'json' );  

Read More

Text Area Dialog that then calls PHP Function

The HTML Head <!– JQUERY UI –> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script> <!–Should be first script imported/first script on the page–> <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/themes/smoothness/jquery-ui.css" type="text/css" media="all" /> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js" type="text/javascript"></script> <script type="text/javascript"> //—————————————- //—– OUR JQUERY ENTER TEXT DIALOG —– //—————————————- $(".our_jquery_dialog").live('click', function(e) { e.preventDefault(); //—– OPTIONAL GET SPECIAL VALUES INCLUDED IN THE LINK —– var usage_id […]

Read More

Manipulating CSS

Example $("#Textbox1").css("width", "90%"); or document.getElementById("MyElement").className = "MyClass";    

Read More

Getting Values

Get Value Of An Attribute HTML <a href="javascript:void(0)" class="our_jquery_dialog" title="The Title" message="A message" usage_id="12345">Open The Form</a> Javascript var usage_id = $(this).attr("usage_id"); Get Value Of A Form TextArea HTML <textarea id='text_area_1' style='width:100%;' rows='2'>Default text</textarea> Javascript var new_text = $('textarea#text_area_1').val();  

Read More

jQuery basics

  Order of files included Should usually be something like. jquery.min.js jquery-ui.js any third partly plugins you loading your custom JS code

Read More

Converting Strings

Convert Value To String var my_value = 15; var my_string = my_value.toString(); Convert String To Int var my_string = "10"; var my_value = parseInt(my_string);    

Read More