Template:2011FR/Form-section-radiobuttons-2: Difference between revisions

From Donate
Jump to navigation Jump to search
Content deleted Content added
Cbarr (talk | contribs)
No edit summary
Cbarr (talk | contribs)
No edit summary
Line 15: Line 15:


#input_amount_other_box{
#input_amount_other_box{
color: #aaaaaa;
/* color: #aaaaaa; */
color: black;
font-size: 0.8em;
font-size: 0.8em;
border:1px solid #c0c0c0;
border:1px solid #c0c0c0;
Line 23: Line 24:
#amount-table{
#amount-table{
font-size: 1.2em;
font-size: 1.2em;
width: 100%;
/*width: 100%;*/
}
}


Line 52: Line 53:
font-size: 0.95em;
font-size: 0.95em;
}
}

a#currency-link{
color: #0645ad;
}

a#currency-link:hover{
color: #0645ad;
background-image: none !important;
padding-right: 0 !important;
cursor: pointer;
}

</style>
</style>


Line 63: Line 76:


function resetOther(box){
function resetOther(box){
//box.value = "</html>{{int:donate_interface-other}}<html>";
box.value = "</html>{{int:donate_interface-other}}<html>";
box.value = "</html>{{int:donate_interface-other}}<html>";
box.style.color = "#aaaaaa";
//box.style.color = "#aaaaaa";
}
}


function selectAmount(){
function selectAmount(){
document.getElementById("input_amount_other_box").value = "</html>{{int:donate_interface-other}}<html>";
//document.getElementById("input_amount_other_box").value = "</html>{{int:donate_interface-other}}<html>";
document.getElementById("input_amount_other_box").style.color = "#aaaaaa";
document.getElementById("input_amount_other_box").value = "";
//document.getElementById("input_amount_other_box").style.color = "#aaaaaa";
document.getElementsByName("amountGiven")[0].value="";
}
}


function validateForm(form){
function triggerClick(elem){
$('#' + elem + '-container-contained').show();
}


function loadCountry(){
var minimums = {
//alert(window.location);
'USD' : 1,
//var newPage = window.location.value;
'GBP' : 1, // $1.26
//newCountry = $("#currency-select").value;
'EUR' : 1, // $1.26
//newPage.replace("</html>{{{country}}}<html>",newCountry);
'AUD' : 2, // $1.35
//alert(newPage);
'CAD' : 1, // $0.84
//window.location = newPage;
'CHF' : 1, // $0.85
//return false;
'CZK' : 20, // $1.03
'DKK' : 5, // $0.85
'HKD' : 10, // $1.29
'HUF' : 200, // $0.97
'JPY' : 100, // $1
'NZD' : 2, // $1.18
'NOK' : 10, // $1.44
'PLN' : 5, // $1.78
'SGD' : 2, // $1.35
'SEK' : 10, // $1.28
'ILS' : 5 // $1.39
};

var error = true;

// Get amount selection
for ( var i = 0; i < form.amount.length; i++ ) {
if ( form.amount[i].checked ) {
amount = form.amount[i].value;
}
}
if ( form.input_amount_other_box.value != "</html>{{int:donate_interface-other}}<html>" ) {
var otherAmount = form.input_amount_other_box.value;
otherAmount = otherAmount.replace(/[,.](\d)$/, '\:$10');
otherAmount = otherAmount.replace(/[,.](\d)(\d)$/, '\:$1$2');
otherAmount = otherAmount.replace(/[\$,.]/g, '');
otherAmount = otherAmount.replace(/:/, '.');
form.input_amount_other_box.value = otherAmount;
form.amountGiven.value = otherAmount;
amount = otherAmount;
}

// Check amount is a real number
error = ( amount == null || isNaN( amount ) || amount.value <= 0 );
// Check amount is at least the minimum
var currency = form.currency_code.value;
if ( typeof( minimums[currency] ) == 'undefined' ) {
minimums[currency] = 1;
}
if ( amount < minimums[currency] || error ) {
alert( '</html>{{{validation-error-minimum|You must contribute at least $1}}}<html>'.replace('$1', minimums[currency] + ' ' + currency ) );
error = true;
}
return !error;
}
}
</script>


<input type="hidden" name="currency_code" value="</html>{{{currency|{{2011FR/core-currency-code|{{{country}}}}}}}}<html>"/>
</script>


<div>
<div>

Revision as of 03:06, 23 November 2011

Donation amount
⧼donate_interface-country-dropdown-{{{country}}}⧽ not your country?