dezio Posted January 25, 2013 Share Posted January 25, 2013 I would like to add my jQuery code so when I enter domain pricing for 1 year period, jQuery automatically add values to "2,3,4... years" fields but I cannot find where is that template.. Can someone help me? I find out hook "AdminAreaHeadOutput" but it didnt run on "Open Pricing" popup page. Also maybe this is a suggestion but I think jQuery script tag should come before executing AdminAreaHeadOutput hooks because when someone want to hook some jQuery code, problem is that jQuery isnt still active. 0 Quote Link to comment Share on other sites More sharing options...
WHMCS JamesX Posted January 25, 2013 Share Posted January 25, 2013 but I cannot find where is that template There isn't one for that particular page; it's all embedded. 0 Quote Link to comment Share on other sites More sharing options...
dezio Posted January 25, 2013 Author Share Posted January 25, 2013 I cant find it, is it encrypted? Because I didn't find any hook related to this, i appended code inside jquery core. This is a code if someone want to have this functionality: $(document).ready(function(){ if (location.href.match(/configdomains\.php\?action=editpricing/)) { $('form').before('<input type="checkbox" id="automatically_fill_years" /> Automatically fill 2-10 years based on first year value'); $('form').submit(function(){ if( ! $('#automatically_fill_years').is(':checked') ) return true; var $form = $(this); var $register = $form.find('input[name^="register\\[0\\]"][name$="\\[1\\]"]'); var $transfer = $form.find('input[name^="transfer\\[0\\]"][name$="\\[1\\]"]'); var $renew = $form.find('input[name^="renew\\[0\\]"][name$="\\[1\\]"]'); $register.each(function(){ var price = parseFloat( $(this).val() ); var name_array = $(this).attr('name').match(/[0-9]+/g); var currency_id = name_array[1]; for(i = 2; i <= 10; i++) { var $input = $form.find('input[name="register\\[0\\]\\[' + currency_id + '\\]\\[' + i + '\\]"]'); if( parseInt( $input.val() ) != -1 ) $input.val( ( price * i ).toFixed(2) ); } }); $transfer.each(function(){ var price = parseFloat( $(this).val() ); var name_array = $(this).attr('name').match(/[0-9]+/g); var currency_id = name_array[1]; for(i = 2; i <= 10; i++) { var $input = $form.find('input[name="transfer\\[0\\]\\[' + currency_id + '\\]\\[' + i + '\\]"]'); if( parseInt( $input.val() ) != -1 ) $input.val( ( price * i ).toFixed(2) ); } }); $renew.each(function(){ var price = parseFloat( $(this).val() ); var name_array = $(this).attr('name').match(/[0-9]+/g); var currency_id = name_array[1]; for(i = 2; i <= 10; i++) { var $input = $form.find('input[name="renew\\[0\\]\\[' + currency_id + '\\]\\[' + i + '\\]"]'); if( parseInt( $input.val() ) != -1 ) $input.val( ( price * i ).toFixed(2) ); } }); }); } }); 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.