私は与えられたドロップダウンメニューの値に基づいてユーザーが独自の部品番号を作成することができる部品番号クリエータータイプのエンジンを作成しようとしています。 。私はそれがユーザーが入力した値を取って、間隔のない部品番号にコンパイルするようにしたい。私はあなたがチェックボックスをクリックすると、あなたはあなたの関数(this.formを)に送信ドロップダウンメニューの選択方法は値の連結を示します
//I want to use a function like this - if there is a value
function FillSeries(f) {
if(f.completepart.checked == true) {
f.ser_sel.value = f.finishedser_sel.value; //finishedser_sel would be the place holder for the value of ser_sel in the concantenated part
f.cap_sel.value = f.finishedcap_sel.value; //finishedcap_sel would be the place holder for the value of cap_sel in the concantenated part
}
}
<form action="#" method="post">
<fieldset>
<table id="tbl_sel" class="tables" border="0" cellspacing="0" cellpadding="0">
<thead>
<tr>
<th class="fst">SERIES</th>
<th>CAP</th>
</tr>
</thead>
<tbody>
<tr>
<td><select id="ser_sel" class="txt">
<option value=""></option>
<option value="620">620</option>
<option value="621">621</option>
</select></td>
<td><input id="cap_sel" class="txt hd" maxlength="3" type="text" /></td>
</tr>
</tbody>
</table>
</fieldset>
</form>
<!--not sure where to put this - inside or outside the form -->
<input type="checkbox" name="completepart" onclick="FillSeries(this.form)">
<em>Check this box if you are done creating a part number.</em>
<br><br>
<!-- I want the part number to pull the fields together into one line - all together with no spacing -->
<b>Finished Part Number</b>
<br><br>
<input class="txt" id="finishedser_sel">
<input class="txt" id="finishedcap_sel">
あなたのコード –
をインデントしてください* * "立ち往生しているように見える" 技術的な問題の説明ではありません。実際の問題と疑問は何ですか? – charlietfl
@ singeの提案に役立つスニペットを編集しているときに、「整頓」ボタンがあります。あなたがどのような問題を抱えているかは完全には分かりません。連結する場合は、連結演算子 '+'を使用します。 –