2012-07-17 82 views
0

我正在開發一個Web應用程序,我必須在其中集成一個Paypal帳戶。網頁上有許多單選按鈕,代表各種信用,價格和智慧。我的問題是,我想要一些功能,通過它我可以在其中一個單選按鈕上單擊來設置各種其他表單域。每個單選按鈕的值都不相同。在特定的單選按鈕上單擊設置多個窗體字段

<form action='<?php echo $paypal_url; ?>' method='post' name='form'> 
    <div class="crea_paka_title">Creadit Pakages</div> 
    <?php 
    foreach($admin_credits as $credits){ 
    ?> 
     <div class="creadit_fields"> 
      <span class="for_radio"> 
       <input type="radio" name="1" id="<?php echo $credits['AdminCredit']['id'];?>" value="" /> 
      </span> 
      <span class="for_creadit"> 
       <?php echo $credits['AdminCredit']['tx_total_credits']; ?> Credits 
      </span> 
      <span class="for_cre_value"> 
       $<?php echo $credits['AdminCredit']['nu_total_price']; ?> 
      </span> 
     </div> 
     <div style="clear:both;"></div> 
    <?php 
    } 
    ?> 
<input type='hidden' name='business' value='<?php echo $paypal_id; ?>'> 
<input type='hidden' name='cmd' value='_xclick'> 
<input type='hidden' name='item_name' value='<?php echo $credits['AdminCredit']['tx_total_credits'];?> Credits'> 
<input type='hidden' name='item_number' value='<?php echo $credits['AdminCredit']['id'];?>'> 
<input type='hidden' name='amount' value='<?php echo $credits['AdminCredit']['nu_total_price'];?>'> 
<input type='hidden' name='no_shipping' value='1'> 
<input type='hidden' name='currency_code' value='USD'> 

就像上面在我的代碼中,我必須改變單選按鈕點擊輸入值。任何建議表示讚賞。

enter image description here

+0

@DainisAbols:沒有。我不是在談論它。我必須在單選按鈕上單擊設置多個輸入字段。 – 2012-07-17 11:05:55

回答

0

jQuery將做到這一點:

$("#rbID").click(finction(){ 
    $("otherRB").attr("checked",true); 
}); 
相關問題