duannaoye0732
2016-10-26 06:14
采纳率: 100%
浏览 55
已采纳

无法加载页面

I want to pass value from my first form to another but when i pass only single value it opens the page but when i try to pass more than one value it doesn't open the page.

With only one value, it works finely.

<script type="text/javascript">
$(document).ready(function() {
$("#div1").load("http://ppp.qwert.com/wp-content/themes/thestory/compare-form-site.php?loanamt=" + <?php echo $_POST['loanAmt']; ?>); 
});             
</script>

With more than,one it fails to load the page. I am getting error only for character value which i am capturing. like any element with character value not defined. How do i solve this error.

$("#div1").load("http://ppp.qwert.com/wp-content/themes/thestory/compare-form-site.php?loanamt="+<?php echo $_POST['loanAmt'];?>+"&occupation="+<?php echo $_POST['occupation']; ?>+"&rateType="+<?php echo $_POST['rateType']; ?>+"&age="+<?php echo $_POST['age']; ?>+"&city="+<?php echo $_POST['city']; ?> );

here is my html code

<div id="dynamicform" class="dynamicform">
  <div class="formDiv" id="offeringTypeIdDiv_31">
    <form name="offeringTypeIdForm_31" id="offeringTypeIdForm_31" action="http://ppp.qwerty.com/16708-2?q=gold+loan" method="post" >
      <input type="hidden" name="offeringTypeId" value="31">
      <input type="hidden" name="q" value="gold+loan">   
      <div class="fStep1" id="fStep1">
          <input type="hidden" value="15" name="product_id"/>
        <h3>Compare Gold Loan Offers</h3>
        <div class="form-main">
          <label class="formLabel">Purpose</label>
          <select id="purpose" class="inputwraprer" tabindex="0" style="width: 100%; height: 39px;">
            <option value="">Purpose</option>
            <option value="Gold Loan" selected="selected">Gold Loan</option>
          </select>
        </div>
        <div class="form-main">
          <label class="formLabel">Loan Amount</label>
          <input type="text" name="loanAmt" id="loanAmt" value="" class="inputwraprer" required tabindex="1" autocomplete="off" placeholder="Enter Loan Amount" />
        </div>
      </div>
      <div style="clear:both;"></div>
      <div class="fStep2" id="fStep2">
        <div class="form-main">
          <label class="formLabel">Occupation</label>
          <select name="occupation" class="inputwraprer" required tabindex="2" style="width: 100%; height: 39px;">
            <option value="">Occupation</option>
            <option value="Salaried"
                            >Salaried</option>
            <option value="self+Employed"
                            >Self Employed</option>
          </select>
        </div>
        <div style="clear:both"></div>
        <div class="form-main">
          <label class="formLabel">Interest Type</label>
          <span class="putradio">
          <input class="radioButton required" type="radio" id="fixed" value="Fixed" name="rateType" tabindex="3" />
          Fixed</span> <span class="putradio">
          <input class="radioButton" type="radio" id="floating" value="Floating" name="rateType" tabindex="4" />
          Floating</span> <span class="putradio">
          <input class="radioButton" type="radio" id="both" value="Both" name="rateType" tabindex="5" />
          Both</span> </div>
        <div style="clear:both"></div>
        <div class="form-main">
          <label class="formLabel">Age</label>
          <select id="age" class="inputwraprer" required tabindex="6" name="age" style="width: 100%; height: 39px;">
            <option value="">Age</option>
            <option value="18"
                            >18 Years</option>
            <option value="19"
                            >19 Years</option>
            <option value="20"
                            >20 Years</option>
            <option value="21"
                            >21 Years</option>
            <option value="22"
                            >22 Years</option>
            <option value="23"
                            >23 Years</option>
            <option value="24"
                            >24 Years</option>
            <option value="25"
                            >25 Years</option>
          </select>
        </div>
        <div style="clear:both"></div>
        <div class="form-main" id="cityDiv">
          <label id="cityLabel" class="formLabel">City</label>
          <input type="hidden" id="cityTextBox" name="cityTextBox" />
          <select id="city" name="city" class="inputwraprer" placeholder="Enter a city" style="width: 100%; height: 39px;" required tabindex="7">
            <option value="" selected="selected">Select a city</option>
            <option value="9">Bangalore</option>
            <option value="20">Chennai</option>
            <option value="27">Faridabad</option>
            <option value="28">Ghaziabad</option>
            <option value="32">Gurgaon</option>
            <option value="36">Howrah</option>
            <option value="38">Hyderabad</option>
            <option value="49">Kolkata</option>
            <option value="57">Mumbai</option>
          </select>
        </div>
      </div>
      <div style="clear:both"></div>
      <div class=" form-main" style="text-align: center;margin: 10px 0 15px;">
        <input type="submit" name="submitForm" value="Compare" class="submitButton" id="submitForm">
      </div>
    </form>
  </div>
</div>
  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

2条回答 默认 最新

相关推荐 更多相似问题