0

我已经建立了一家 Tictail 商店,作为高中助推器俱乐部的筹款方式。我也希望能够收集现金捐款,但是(长话短说)为了让俱乐部避免潜在的纳税义务,我们更愿意通过地区的基金会来收集这些捐款。该基金会有一个我们喜欢使用的网络表单选项。(如果可能的话)

我们没有服务器访问任何正在讨论的页面。

以下是我提出的选项(按优先顺序):

选项1:

从我们的 Tictail 网站上的基金会网站重新创建(刮掉?)表单的相关部分,并为其提供与基金会网站上相同的功能。

我一直在尝试使用 jQuery,但我有点迷路了。

选项 2:

  • 将基础站点加载到iframe我们的 Tictail 站点上
  • 在“捐赠以支持斯普林菲尔德公立学校”旁边的字段中,使用我们的团体名称自动填充它。
  • 当您单击提交时打开结果,但不在 iframe 中

选项 3:

  • 当点击从 Tictail 站点到基础站点的链接时,基础站点加载
  • 在“捐赠以支持斯普林菲尔德公立学校”旁边的字段中,使用我们的团体名称自动填充它。

我对 CSS 和 Javascript 有一点经验,但也够危险了。我真的希望这里有人能理解我的问题并提供解决方案。


更新:

除了提交按钮之外,我使用以下代码在不同页面上的测试环境中获得了所有内容:

<script type="text/javascript" 
src="/jquery/jquery-1.3.2.min.js"></script>

<div id="container" align="center">

<p>Call the FSPS office at 417-523-0144 to donate or simply enter information below.</p>
<p><script type="text/javascript">// <![CDATA[
jQuery(document).ready(function () {
var updateTotals = function() {
    var total = 0;
    var description = "";
    if (!(isNaN(parseFloat(jQuery("#donateQty").val())) || parseFloat(jQuery("#donateQty").val()) <= 0)) {
        total += jQuery("#donateQty").val() * 1;
        description += "$" + jQuery("#donateQty").val() + " donation. ";
    }
    var processingFeeAmount = 0.0;
    if (jQuery("#donateProcessingFee").is(":checked")) {
        processingFeeAmount = total * 0.03;
        total += processingFeeAmount;
        jQuery("#processingFeeAmount").text("$" + processingFeeAmount.toFixed(2));
    }
    if (jQuery("#donateProject").val()) {
        description += " Donation designated for: " + jQuery("#donateProject").val() + ".";
    }
    if(jQuery("#donateAnonymously").is(":checked")) {
        description += " This is an anonymous donation.";
    }
    if (jQuery("#donateProcessingFee").is(":checked")) {
        description += " This includes a processing fee donation.";
    }
    jQuery("#totalPrice").text("$"+total.toFixed(2));
    jQuery("#x_amount").val(total.toFixed(2));
    jQuery("#x_description").val(description);
};
jQuery("#donateQty").change(function() {
    if (!isNaN(jQuery(this).val())) {
        jQuery("#donatePrice").text("$"+(jQuery(this).val()* 1).toFixed(2));
        updateTotals();
    }
});
    jQuery("#donateProject").change(function() {
            updateTotals();
    });
jQuery("#donateAnonymously").change(function() {
    updateTotals();
});
jQuery("#donateProcessingFee").change(function() {
    if (jQuery(this).is(":checked")) {
        jQuery("#trProcessingFeeAmount").show();
    } else {
        jQuery("#trProcessingFeeAmount").hide();
    }
    updateTotals();
});
});
</script></p>
<form method='POST'>
                        <input id='x_amount' name='x_amount' type='hidden' value='0' /> 
                        <input id='x_description' name='x_description' type='hidden' /> 
                        </p>
<table>
<tbody>
<tr>
<td style="text-align: left;">Donation amount:</td>
<td><input id="donateQty" style="width: 50px;" size="5" type="text" /></td>
<td></td>
<td><span id="donatePrice">$0.00</span></td>
</tr>
<tr id="trProcessingFeeAmount" style="display: none;">
<td style="text-align: right !important;" colspan="3">PROCESSING FEE DONATION:</td>
<td><span id="processingFeeAmount">$0.00</span></td>
</tr>
<tr>
<td style="text-align: right !important;" colspan="3">TOTAL AMOUNT DUE:</td>
<td><span id="totalPrice">$0.00</span></td>
</tr>
<tr>
<td style="text-align: left !important;" colspan="2">Donation should be directed to:</td>
<td style="text-align: right !important;" colspan="2"><input id="donateProject" style="width:     150px;" size="150" type="text" value="CHS Kilties" /></td>
</tr>
<tr>
<td colspan="4">
<div style="float: right; text-align: left;"><span><label for="donateAnonymously"><br />
<input id="donateAnonymously" type="checkbox" /> I wish to remain Anonymous.</label></span><span>            <label for="donateProcessingFee"><br />
<input id="donateProcessingFee" type="checkbox" /> Add 3% to my gift to cover processing fees, so 100% of my gift goes to FSPS.</label></span></div>
</td>
</tr>
<tr>
<td colspan="2"></td>
<td colspan="2"><input type="submit" value="Checkout" /></td>
</tr>
</tbody>
</table>
<p>
                   </form>

</div><!-- #content -->


<!--div id="footer" role="contentinfo">
</div--><!-- #footer -->

</div><!-- #wrapper -->
<div style="clear: both;"></div>
</div><!-- #container -->

<script type='text/javascript' src='http://supportsps.org/wp-content/plugins/contact-form- 7/jquery.form.js?ver=2.52'></script>
<script type='text/javascript' src='http://supportsps.org/wp-content/plugins/contact-form-7/scripts.js?ver=2.4.3'></script>
<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-15690751-2']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>

但是当我将它粘贴到 Tictail 页面时,没有任何计算或功能起作用。

4

1 回答 1

0

除了提交按钮之外,我得到了一切:

<div class="html_content" align="center">

<html lang="en-US">
<head>
<meta charset="UTF-8" />
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="http://supportsps.org/xmlrpc.php" />
<link rel="alternate" type="application/rss+xml" title="supportsps.org &raquo; Feed"     href="http://supportsps.org/feed/" />
<link rel="alternate" type="application/rss+xml" title="supportsps.org &raquo; Comments Feed" href="http://supportsps.org/comments/feed/" />
<link rel='stylesheet' id='contact-form-7-css' href='http://supportsps.org/wp-    content/plugins/contact-form-7/styles.css?ver=2.4.3' type='text/css' media='all' />
<script type='text/javascript' src='http://supportsps.org/wp-includes/js/jquery/jquery.js?ver=1.8.3'></script>
<script type='text/javascript' src='http://supportsps.org/wp-includes/js/comment-reply.min.js?ver=3.5.1'></script>
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://supportsps.org/xmlrpc.php?rsd" />
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://supportsps.org/wp-includes/wlwmanifest.xml" />
<link rel='canonical' href='http://supportsps.org/donate/' />
</head>
<script type="text/javascript">
jQuery(document).ready(function () {
var sOffset = jQuery("#sidebar").offset();
var cOffset = jQuery("#content").offset();
var sdiffHeight = jQuery("#sidebar").outerHeight() - jQuery("#sidebar").height();
var cdiffHeight = jQuery("#content").outerHeight() - jQuery("#content").height();
var height = Math.max(cOffset.top + jQuery("#content").outerHeight(), sOffset.top +     jQuery("#sidebar").outerHeight());
jQuery("#sidebar").height(height - sOffset.top - sdiffHeight);
jQuery("#content").height(height - cOffset.top - cdiffHeight);
});
</script>
<div id="sidebar">
</div>
<div id="content" role="main">
<center><p><h2>Call the Foundation for Springfield Public Schools office at</p>
<p>417-523-0144 or simply use the form below.</h2></p></center>
<p><script type="text/javascript">// <![CDATA[
jQuery(document).ready(function () {
var updateTotals = function() {
var total = 0;
var description = "";
if (!(isNaN(parseFloat(jQuery("#donateQty").val())) ||     parseFloat(jQuery("#donateQty").val()) <= 0)) {
total += jQuery("#donateQty").val() * 1;
description += "$" + jQuery("#donateQty").val() + " donation. ";
}
var processingFeeAmount = 0.0;
if (jQuery("#donateProcessingFee").is(":checked")) {
processingFeeAmount = total * 0.03;
total += processingFeeAmount;
jQuery("#processingFeeAmount").text("$" + processingFeeAmount.toFixed(2));
}
if (jQuery("#donateProject").val()) {
description += " Donation designated for: " + jQuery("#donateProject").val() + ".";
}
if(jQuery("#donateAnonymously").is(":checked")) {
description += " This is an anonymous donation.";
}
if (jQuery("#donateProcessingFee").is(":checked")) {
description += " This includes a processing fee donation.";
}
jQuery("#totalPrice").text("$"+total.toFixed(2));
jQuery("#x_amount").val(total.toFixed(2));
jQuery("#x_description").val(description);
};
jQuery("#tabQty").change(function() {
if (!isNaN(jQuery(this).val())) {
jQuery("#tabPrice").text("$"+(jQuery(this).val()* 35).toFixed(2));
updateTotals();
}
});
jQuery("#tableQty").change(function() {
if (!isNaN(jQuery(this).val())) {
jQuery("#tablePrice").text("$"+(jQuery(this).val()* 350).toFixed(2));
updateTotals();
}
});
jQuery("#wilQty").change(function() {
if (!isNaN(jQuery(this).val())) {
jQuery("#wilPrice").text("$"+(jQuery(this).val()* 15.95).toFixed(2));
updateTotals();
}
});
jQuery("#donateQty").change(function() {
if (!isNaN(jQuery(this).val())) {
jQuery("#donatePrice").text("$"+(jQuery(this).val()* 1).toFixed(2));
updateTotals();
}
});
jQuery("#donateProject").change(function() {
updateTotals();
});
jQuery("#donateAnonymously").change(function() {
updateTotals();
});
jQuery("#donateProcessingFee").change(function() {
if (jQuery(this).is(":checked")) {
jQuery("#trProcessingFeeAmount").show();
} else {
jQuery("#trProcessingFeeAmount").hide();
}
updateTotals();
});
});
// ]]&gt;</script></p>
<form method='POST'>
<input id='x_amount' name='x_amount' type='hidden' value='0' />
<input id='x_description' name='x_description' type='hidden' />
</p>
<table>
<tbody>
<tr>
<td style="text-align: left;">Donation amount:</td>
<td><input id="donateQty" style="width: 50px;" size="5" type="text" /></td>
<td></td>
<td><span id="donatePrice">$0.00</span></td>
</tr>
<tr id="trProcessingFeeAmount" style="display: none;">
<td style="text-align: right !important;" colspan="3">3% PROCESSING FEE:</td>
<td><span id="processingFeeAmount">$0.00</span></td>
</tr>
<tr>
<td style="text-align: right !important;" colspan="3">TOTAL AMOUNT DUE:</td>
<td><span id="totalPrice">$0.00</span></td>
</tr>
<tr>
<td style="text-align: left !important;" colspan="2">Direct donation to:</td>
<td style="text-align: right !important;" colspan="2"><input id="donateProject"     style="width: 150px;" size="150" type="text" value="CHS Kilties" /></td>
</tr>
<tr>
<td colspan="4">
<div style="float: right; text-align: left;"><span><label for="donateAnonymously"><br />
<input id="donateAnonymously" type="checkbox" /> I wish to remain Anonymous.</label>    </span><span><label for="donateProcessingFee"><br />
<input id="donateProcessingFee" type="checkbox" /> Add 3% to my donation for processing     fees, so 100% goes to the Kilties.</label></span></div>
</td>
</tr>
<tr>
<td colspan="2"></td>
<td colspan="2"><input type="submit" value="Checkout" /></td>
</tr>
</tbody>
</table>
</form>
</div><!-- #content -->
<!--div id="footer" role="contentinfo">
</div--><!-- #footer -->
</div><!-- #wrapper -->
<div style="clear: both;"></div>
</div><!-- #container -->
<script type='text/javascript' src='http://supportsps.org/wp-content/plugins/contact-form-    7/jquery.form.js?ver=2.52'></script>
<script type='text/javascript' src='http://supportsps.org/wp-content/plugins/contact-form-    7/scripts.js?ver=2.4.3'></script>
<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-15690751-2']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>
</body>
</html>

但是表格上方大约有 2-3 英寸的空间。你可以在这里看到页面。一切似乎都在发生,<div id="sidebar">因为如果我删除该行,空间就会消失,但所有功能也会消失。有任何想法吗?

于 2013-08-30T02:40:18.847 回答