Template:2012France/lp-form: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
copying over for Wikimedia France pages |
No edit summary |
||
(16 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<html> |
<html> |
||
⚫ | |||
⚫ | |||
/* Conversion des virgules en points, interdiction des lettres */ |
/* Conversion des virgules en points, interdiction des lettres */ |
||
function verificationsaisie() { |
function verificationsaisie() { |
||
var amountGiven = document.getElementById('amountGiven'); |
var amountGiven = document.getElementById('amountGiven'); |
||
var firstChar = amountGiven.value.charAt(0); |
var firstChar = amountGiven.value.charAt(0); |
||
if (('1' > firstChar) || ('9' < firstChar)) |
if (('1' > firstChar) || ('9' < firstChar)) |
||
amountGiven.value = amountGiven.value.substr(1); |
amountGiven.value = amountGiven.value.substr(1); |
||
amountGiven.value = amountGiven.value.replace(/[^0-9.,]/g, '').replace(/^([0-9]*[.,][0-9]*)[.,]*/g, '$1'); |
amountGiven.value = amountGiven.value.replace(/[^0-9.,]/g, '').replace(/^([0-9]*[.,][0-9]*)[.,]*/g, '$1'); |
||
amountGiven.value = amountGiven.value.replace(/,/, '.'); |
amountGiven.value = amountGiven.value.replace(/,/, '.'); |
||
return; |
return; |
||
} |
} |
||
Line 36: | Line 35: | ||
error = true; |
error = true; |
||
} |
} |
||
document. |
document.contribform.amount.value = Math.floor(eval(amount)*100) ; |
||
return !error; |
return !error; |
||
} |
} |
||
function redirectPayment(i) { |
function redirectPayment(i) { |
||
⚫ | |||
//if i == 1 |
|||
var action_url = "</html>{{{donate-url}}}<html>"; |
|||
⚫ | |||
⚫ | |||
if (i==2) {action_url="http://wikimediafoundation.org/wiki/Special:ContributionTracking/</html>{{{language|{{BASEPAGENAME}}}}}<html>"; |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
} |
|||
} |
} |
||
</script> |
</script> |
||
<form method="post" name=" |
<form method="post" name="contribform"> |
||
<input type="hidden" name="gateway" value="paypal" /> |
<input type="hidden" name="gateway" value="paypal" /> |
||
<input type="hidden" name="utm_source" value="" /> |
<input type="hidden" name="utm_source" value="" /> |
||
Line 66: | Line 61: | ||
<input type="hidden" name="returnto" value="Thank_You/</html>{{{language|{{SUBPAGENAME}}}}}<html>" /> |
<input type="hidden" name="returnto" value="Thank_You/</html>{{{language|{{SUBPAGENAME}}}}}<html>" /> |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
<tr> |
|||
⚫ | <td style="white-space:nowrap;text-align:justify;"><input type="radio" name="input_amount" id="input_amount_0" onclick="document. |
||
⚫ | <td style="white-space:nowrap;text-align:justify;"><input type="radio" name="input_amount" id="input_amount_1" onclick="document. |
||
⚫ | <td style="white-space:nowrap;text-align:justify;"><input type="radio" name="input_amount" id="input_amount_2" onclick="document. |
||
⚫ | |||
<tr> |
|||
⚫ | <td style="white-space:nowrap;text-align:justify;"><input type="radio" name="input_amount" id="input_amount_3" onclick="document. |
||
⚫ | <td style="white-space:nowrap;text-align:justify;"><input type="radio" name="input_amount" id="input_amount_other" value="Other"><label for="input_amount_other"></html>{{{donate-amount-other|<html>Other:</html>}}}<html></label> <input type="text" name="amountGiven" id="amountGiven" size="4" onKeyUp="verificationsaisie()" onfocus="this.form.input_amount_other.checked=true;"> €<br/></td> |
||
</tr> |
|||
⚫ | |||
⚫ | |||
</span> |
|||
<p></p> |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
</form> |
|||
⚫ | |||
</html> |
|||
⚫ | |||
<html> |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
<tr> |
|||
⚫ | <td style="white-space: nowrap; text-align:justify;"><input type="radio" name="input_amount" id="input_amount_0" onclick="document.contribform.amountGiven.value = ''" style="text-align:justify;" value="</html>{{{donate-amount-0}}}<html>"><label for="input_amount_0"> </html>{{{donate-amount-0}}}<html> €</label></td> |
||
⚫ | |||
⚫ | |||
</tr> |
|||
<tr> |
|||
⚫ | |||
⚫ | <td style="white-space: nowrap; text-align:justify;"><input type="radio" name="input_amount" id="input_amount_other" value="Other"><label for="input_amount_other"></html>{{{donate-amount-other|<html>Other:</html>}}}<html></label> <input type="text" name="amountGiven" id="amountGiven" size="4" onKeyUp="verificationsaisie();" onfocus="this.form.input_amount_other.checked=true;"> €<br/></td> |
||
</tr> |
|||
⚫ | |||
</div> |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
<script type="text/javascript"> |
<script type="text/javascript"> |
||
function getQuerystring( key ) |
function getQuerystring( key ) { |
||
{ |
|||
key = key.replace( /[\[]/, '\\\[' ).replace( /[\]]/, '\\\]' ); |
key = key.replace( /[\[]/, '\\\[' ).replace( /[\]]/, '\\\]' ); |
||
var regex = new RegExp( '[\\?&]' + key + '=([a-zA-Z0-9\_\-]*)' ); |
var regex = new RegExp( '[\\?&]' + key + '=([a-zA-Z0-9\_\-]*)' ); |
||
Line 104: | Line 97: | ||
} |
} |
||
function getLandingPage() |
function getLandingPage() { |
||
⚫ | |||
{ |
|||
⚫ | |||
var path = "</html>{{{landing-page|default}}}<html>"; |
|||
if ( path == "default"){ |
|||
pathArray = window.location.pathname.split( '/' ); |
|||
return pathArray[2]; |
|||
} |
|||
else return path; |
|||
} |
} |
||
document.contribform.utm_medium.value = getQuerystring( 'utm_medium' ); |
|||
document. |
document.contribform.utm_campaign.value = getQuerystring( 'utm_campaign' ); |
||
document. |
document.contribform.referrer.value = document.referrer; |
||
document.paypalcontribution.referrer.value = document.referrer; |
|||
</script> |
</script> |
||
</html |
</html> |
||
[[Category:Fundraising templates|{{PAGENAME}}]] |
|||
</noinclude> |
Latest revision as of 14:54, 17 October 2012