Javascript 我需要一个贝宝按钮,以取代提交按钮。现在我两个都有,这很奇怪

Javascript 我需要一个贝宝按钮,以取代提交按钮。现在我两个都有,这很奇怪,javascript,html,paypal-buttons,Javascript,Html,Paypal Buttons,这是我的代码,我有。现在paypal按钮正在提交表单。它现在还没有连接到贝宝。基本上我想要的是当他们到达表单的最后一步时,下一步按钮变成paypal按钮 <div style="overflow:auto;"> <div style="float:right;"> <button type="button" class="form" id="prevBt

这是我的代码,我有。现在paypal按钮正在提交表单。它现在还没有连接到贝宝。基本上我想要的是当他们到达表单的最后一步时,下一步按钮变成paypal按钮

  <div style="overflow:auto;">
    <div style="float:right;">
      <button type="button" class="form" id="prevBtn" onclick="nextPrev(-1)">Previous</button>
      <button type="button" id="nextBtn" onclick="nextPrev(1)">Next</button>
    </div>
  </div>
这是另一个我认为可以修复的函数

function showTab(n) {
  // This function will display the specified tab of the form ...
  var x = document.getElementsByClassName("tab");
  x[n].style.display = "block";
  // ... and fix the Previous/Next buttons:
  if (n == 0) {
    document.getElementById("prevBtn").style.display = "none";
  } else {
    document.getElementById("prevBtn").style.display = "inline";
  }
  if (n == (x.length - 1)) {
    document.getElementById("nextBtn").innerHTML = "Submit";
  } else {
    document.getElementById("nextBtn").innerHTML = "Next";
  }
  // ... and run a function that displays the correct step indicator:
  fixStepIndicator(n)
}

我不能编辑if语句吗?这里的
innerHTML=“submit”
to submit是paypal按钮?我不知道如何将paypal按钮引用到此按钮。

您可以添加一个div或span以包含“下一步”按钮。当一切就绪时,您可以按此代码中的方式替换此按钮


以前的
下一个

我在最后一页没有看到“下一步”按钮。你是说“提交”按钮吗?是的,我刚才说的是“下一步”按钮,因为我让Js把“下一步”按钮变成了“提交”。老实说。我现在肯定很困惑,哈哈
function showTab(n) {
  // This function will display the specified tab of the form ...
  var x = document.getElementsByClassName("tab");
  x[n].style.display = "block";
  // ... and fix the Previous/Next buttons:
  if (n == 0) {
    document.getElementById("prevBtn").style.display = "none";
  } else {
    document.getElementById("prevBtn").style.display = "inline";
  }
  if (n == (x.length - 1)) {
    document.getElementById("nextBtn").innerHTML = "Submit";
  } else {
    document.getElementById("nextBtn").innerHTML = "Next";
  }
  // ... and run a function that displays the correct step indicator:
  fixStepIndicator(n)
}