我正在寻找一种解决方案,当提交表单时,在提交的按钮下会出现一条感谢消息,反对将它重定向到我现在拥有的同一个网页。
我是新手,请举个例子,谢谢。
脚本的相关位是:
<script type="text/javascript">var submitted=false;</script>
<iframe name="hidden_iframe" id="hidden_iframe" style="display:none;"
onload="if(submitted)
{window.location='http://originalblueskythinking.blogspot.co.uk/2013/01/what-drives-us-
fantasies-or-dreams_22.html';}"></iframe>
<form action="https://docs.google.com/spreadsheet/formResponse?
formkey=dFh5VndEdW9JQzVrUU9FdjYteDNfSHc6MQ&ifq" id="ss-form" method="POST"
target="hidden_iframe"
onsubmit="submitted=true;">
<br />
<div class="errorbox-good">
<div class="ss-item ss-item-required ss-radio">
<div class="ss-form-entry">
<label class="ss-q-title" for="entry_0"><b style="font-family: Leelawadee; text-align:
justify;"><span style="color: orange; font-size: large;">What would you say you are
more of, a dreamer or fantasist? </span></b></label><br />
<label class="ss-q-title" for="entry_0"><b style="font-family: Leelawadee; text-align:
justify;"><span style="color: orange; font-size: large;"><br /></span></b></label>
<span style="color: white;"><label class="ss-choice-label"><input class="ss-q-radio"
id="group_0_1" name="entry.0.group" type="radio" value="I'm a dreamer and have a
ideologist natural" />
</label><span style="font-family: Leelawadee; text-align: justify;">I'm a dreamer and
have a ideologist natural</span></span><br />
<span style="color: white; font-size: small;"><input class="ss-q-radio" id="group_0_2"
name="entry.0.group" type="radio" value="I'm a fantasist and I find my self escaping "
/> <span style="font-family: Leelawadee; text-align: justify;">I'm a fantasist
and I find my self escaping</span></span><br />
<br /></div>
</div>
</div>
<br />
<input name="pageNumber" type="hidden" value="0" />
<input name="backupCache" type="hidden" value="" />
<br />
<div class="ss-item ss-navigate">
<div class="ss-form-entry">
<input name="submit" type="submit" value="Submit" /></div>
</div>
</form>
<script type="text/javascript">
(function() {
var divs = document.getElementById('ss-form').
getElementsByTagName('div');
var numDivs = divs.length;
for (var j = 0; j < numDivs; j++) {
if (divs[j].className == 'errorbox-bad') {
divs[j].lastChild.firstChild.lastChild.focus();
return;
}
}
for (var i = 0; i < numDivs; i++) {
var div = divs[i];
if (div.className == 'ss-form-entry' &&
div.firstChild &&
div.firstChild.className == 'ss-q-title') {
div.lastChild.focus();
return;
}
}
})();
</script></div>