Template:2011FR/lp-form-US7amounts: Difference between revisions

From Donate
Jump to navigation Jump to search
Content deleted Content added
No edit summary
Pgehres (WMF) (talk | contribs)
 
(12 intermediate revisions by 6 users not shown)
Line 2: Line 2:


<script type="text/javascript" language="javascript">
<script type="text/javascript" language="javascript">
var stateList = [</html>{{2011FR/stateList}}<html>];

function validateForm( form ) {
function validateForm( form ) {


Line 54: Line 52:
if ( amount < minimums[currency] || error ) {
if ( amount < minimums[currency] || error ) {
alert( '</html>{{{validation-error-minimum|You must contribute at least $1}}}<html>'.replace('$1', minimums[currency] + ' ' + currency ) );
alert( '</html>{{{validation-error-minimum|You must contribute at least $1}}}<html>'.replace('$1', minimums[currency] + ' ' + currency ) );
$( "input[name='amountGiven']" ).val( '' );
$( "input[name='amountGiven']" ).focus();
error = true;
error = true;
}
}
Line 77: Line 77:
//if i == 1
//if i == 1
var paymentType ="cc";
var paymentType ="cc";
var action_url = "https://payments.wikimedia.org/index.php/Special:PayflowProGateway?uselang=</html>{{{language}}}\x26masthead={{{masthead}}}\x26form_name={{{form-name}}}\x26text_template={{{text-template}}}\x26language={{{language|{{SUBPAGENAME}}}}}<html>" ;
var action_url = "https://payments.wikimedia.org/index.php/Special:PayflowProGateway?uselang=</html>{{{language}}}\x26masthead={{{masthead}}}\x26form_name={{{form-name}}}\x26text_template={{{text-template}}}\x26language={{{language|{{SUBPAGENAME}}}}}\x26ffname={{{ffname}}}<html>" ;
//TESLA TESTING
//var action_url = "https://test-payments.tesla.usability.wikimedia.org/index.php/Special:PayflowProGateway?uselang=</html>{{{language}}}\x26masthead={{{masthead}}}\x26form_name={{{form-name}}}\x26text_template={{{text-template}}}\x26language={{{language|{{SUBPAGENAME}}}}}\x26ffname={{{ffname}}}<html>" ;
// Staging
//var action_url = "https://payments4.wikimedia.org/index.php/Special:PayflowProGateway?uselang=</html>{{{language}}}\x26masthead={{{masthead}}}\x26form_name={{{form-name}}}\x26text_template={{{text-template}}}\x26language={{{language|{{SUBPAGENAME}}}}}\x26ffname={{{ffname}}}<html>" ;
if (i==2) {
if (i==2) {
action_url="http://wikimediafoundation.org/wiki/Special:ContributionTracking/</html>{{{language|{{BASEPAGENAME}}}}}<html>";
action_url="https://wikimediafoundation.org/wiki/Special:ContributionTracking/</html>{{{language|{{BASEPAGENAME}}}}}<html>";
paymentType = "pp";
paymentType = "pp";
}
}
Line 98: Line 102:
<input type="hidden" name="language" value="</html>{{{language|{{SUBPAGENAME}}}}}<html>" />
<input type="hidden" name="language" value="</html>{{{language|{{SUBPAGENAME}}}}}<html>" />
<input type="hidden" name="referrer" value="" />
<input type="hidden" name="referrer" value="" />
<input type="hidden" name="country" value="US" />
<input type="hidden" name="returnto" value="Thank_You/</html>{{{language|{{SUBPAGENAME}}}}}<html>" />
<input type="hidden" name="returnto" value="Thank_You/</html>{{{language|{{SUBPAGENAME}}}}}<html>" />
<input type="hidden" name="email-opt" id="input_email" value="1" checked="checked" />
<input type="hidden" name="email-opt" id="input_email" value="1" checked="checked" />
Line 116: Line 121:
<td style="white-space:nowrap;"><input type="radio" name="amount" id="input_amount_6" onclick="document.paypalcontribution. amountGiven.value = ''" value="</html>{{{donate-amount-6}}}<html>" /><label for="input_amount_6"></html>${{{donate-amount-6}}}<html></label></td>
<td style="white-space:nowrap;"><input type="radio" name="amount" id="input_amount_6" onclick="document.paypalcontribution. amountGiven.value = ''" value="</html>{{{donate-amount-6}}}<html>" /><label for="input_amount_6"></html>${{{donate-amount-6}}}<html></label></td>
<td style="white-space:nowrap;"><input type="radio" name="amount" id="input_amount_other" value="Other" /><label for="input_amount_other"></html>{{{donate-amount-other|<html>Other:</html>}}}<html></label>
<td style="white-space:nowrap;"><input type="radio" name="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" size="2" onfocus="this.form.input_amount_other.checked=true;" onKeyPress="return DefaultSubmit(this,event)" /></td>
<input type="text" name="amountGiven" size="2" autocomplete="off" onfocus="this.form.input_amount_other.checked=true;" onKeyPress="return DefaultSubmit(this,event)" /></td>
</tr>
</tr>
</table>
</table>
<!-- currency menu --><input name="currency_code" id="input_currency_code" type="hidden" value="USD" />
<!-- currency menu --><input name="currency_code" id="input_currency_code" type="hidden" value="USD" />
</div>

<div id="card-info-block">
Name on card <br />
<input style="width: 8em;" type="text" class="input-text" id="card_name_first" value="Given" onfocus="clearThis(this,'Given');" onblur="resetThis(this,'Given');" />
<input style="width: 8em;" type="text" class="input-text" id="card_name_last" value="Family" onfocus="clearThis(this,'Family');" onblur="resetThis(this,'Family');" /><br />
Billing address <br />
<input style="width: 16em;" type="text" class="input-text" id="card_address_street_1" value="Street Address 1" onfocus="clearThis(this,'Street Address 1');" onblur="resetThis(this,'Street Address 1');" /><br />
<!-- <input style="width: 16em;" type="text" class="input-text" id="card_address_street_2" value="Street Address 2" onfocus="clearThis(this,'Street Address 2');" onblur="resetThis(this,'Street Address 2');" /><br /> -->
<input style="width: 7em;" type="text" class="input-text" id="card_address_city" value="City" onfocus="clearThis(this,'City');" onblur="resetThis(this,'City');" />
<!-- <input style="width: 5em;" type="text" class="input-text" id="card_address_state" value="State" onfocus="clearThis(this,'State');" onblur="resetThis(this,'State');" /> -->

<select id="card_address_state" size="1" style="vertical-align: middle; width:5em; font-size:95%;" onclick="recolorThis(this);">
<script type="text/javascript">
var opt = document.createElement("option");
opt.selected = true;
opt.text = "State";
opt.value = "State";
document.getElementById("card_address_state").options.add(opt);

for(i=0; i<stateList.length; i++)
{
opt = document.createElement("option");
opt.text = stateList[i];
opt.value = stateList[i];
document.getElementById("card_address_state").options.add(opt);
}
</script>
</select>

<input style="width: 4em;" type="text" class="input-text" id="card_address_zip" value="Zip" onfocus="clearThis(this,'Zip');" onblur="resetThis(this,'Zip');" /><br />
E-mail receipt to <br />
<input style="width: 16em;" type="text" class="input-text" id="card_email" value="Email Address" onfocus="clearThis(this,'Email Address');" onblur="resetThis(this,'Email Address');" />
</div>
</div>


Line 175: Line 147:


<script type="text/javascript">
<script type="text/javascript">
function clearThis(elem,initialString)
//This function empties the "Other" Box.
{
elem.style.color = "#000000";

if(elem.value == initialString)
elem.value = "";
}

function resetThis(elem,resetString)
{
if(elem.value == "")
{
elem.style.color = "#666666";
elem.value = resetString;
}
}

function recolorThis(elem)
{
elem.style.color = "#000000";
}

function getQuerystring( key ) {
function getQuerystring( key ) {
key = key.replace( /[\[]/, '\\\[' ).replace( /[\]]/, '\\\]' );
key = key.replace( /[\[]/, '\\\[' ).replace( /[\]]/, '\\\]' );

Latest revision as of 21:36, 19 October 2012

{{{gift-amount-text}}}

*  *  *