要合并两个下拉列表的值,并使用javascript将值传递给隐藏字段

时间:2011-07-25 04:40:30

标签: php mysql

<form name="payment_info" id="payment_info" action="https://www.myvirtualmerchant.com/VirtualMerchant/process.do" method="post" >
    <div class="check_form_cover">
        <div class="check_form_txt fleft">Account Number:</div>
        <div class="check_form_field fleft"><input name="ssl_card_number" id="ssl_card_number"  type="text" class="check_form_field1" /></div>
        <div class="clear"></div>
    </div>
    <div class="check_form_cover">
        <div class="check_form_txt fleft">Expiry Date:</div>
        <div class="check_form_field fleft"><select name="month" id="month" onchange="setOptions(document.payment_info.month.value);">
            <option value="">Month</option>
            <option value="1">Jan</option>
            <option value="2">Feb</option>
            <option value="3">Mar</option>
            <option value="4">Apr</option>
            <option value="5">May</option>
            <option value="6">Jun</option>
            <option value="7">Jul</option>
            <option value="8">Aug</option>
            <option value="9">Sep</option>
            <option value="10">Oct</option>
            <option value="11">Nov</option>
            <option value="12">Dec</option>
        </select>

        <select name="year" id="year">
            <option value="">Year</option>
            <option value="2011">2011</option>
            <option value="2012">2012</option>
            <option value="2013">2013</option>
            <option value="2014">2014</option>
            <option value="2015">2015</option>
        </select>

    </div>
    <div class="clear"></div>
</div>

<input type="hidden" name="ssl_show_form" id="ssl_show_form" value="TRUE">
<input type="hidden" name="ssl_show_form" id="ssl_show_form" value="TRUE">
<input type="hidden" name="ssl_amount" id="ssl_amount" value="'.$total.'">
<input type="hidden" name="ssl_cvv2cvc2_indicator" id="ssl_cvv2cvc2_indicator" value="Present">
<div class="check_form_cover">
    <div class="check_form_txt fleft">CVV Number:</div>
    <div class="check_form_field fleft"><input name="ssl_cvv2cvc2" id="ssl_cvv2cvc2"  type="text" class="check_form_field1" /></div>
    <div class="clear"></div>
</div>

<div class="check_form_cover">
    <div class="check_form_txt fleft"></div>
    <div class="check_form_field fleft" align="right">
        <input type="image"  src="images/pay_now.jpg" name="payment" id="payment" value="Pay" alt="Pay">
    </div>
    <div class="clear"></div>
</div>

组合名为month和year的值下拉框,并将它们组合为与隐藏字段相同的形式。

1 个答案:

答案 0 :(得分:1)

很难理解你的问题,我不确定它是否有任何关于mysql的事情。

只要您在同一“表格”下拥有所有“输入”,它就会合并。

希望有意义。