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

Content deleted Content added
Cbarr (talk | contribs)
No edit summary
Cbarr (talk | contribs)
No edit summary
Line 15:
 
#input_amount_other_box{
/* color: #aaaaaa; */
color: black;
font-size: 0.8em;
border:1px solid #c0c0c0;
Line 23 ⟶ 24:
#amount-table{
font-size: 1.2em;
/*width: 100%;*/
}
 
Line 52 ⟶ 53:
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>
 
Line 63 ⟶ 76:
 
function resetOther(box){
if ( form.input_amount_other_box//box.value != "</html>{{int:donate_interface-other}}<html>" ) {;
box.value = "</html>{{int:donate_interface-other}}<html>";
//box.style.color = "#aaaaaa";
}
 
function selectAmount(){
//document.getElementById("input_amount_other_box").value = "</html>{{int:donate_interface-other}}<html>";
document.getElementById("input_amount_other_box").style.colorvalue = "#aaaaaa";
//document.getElementById("input_amount_other_box").style.color = "#aaaaaa";
document.getElementsByName("amountGiven")[0].value="";
}
 
function validateFormtriggerClick(formelem){
$('#' + 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 !errorfalse;
'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>