用于创建行的Tab键 [英] Tab key to create rows

查看:62
本文介绍了用于创建行的Tab键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当在表格第一行的最后一个单元格中按Tab键时,是否可以在客户端创建行


表格是这样的


cell1 |小区2 | cell3 | cell4 | cell5 |

____ | ____ | _____ | ____ | ____ | _



在第一个单元格选择框中给出第二个选择框并保留列文本框

Is it possible to create row on client side when tab key is pressed in the last cell of the first row of the table

table is something like this

cell1| cell2| cell3 |cell4| cell5|
____|____|_____|____|____ |_


in the first cell select box is given second select box and remaining columns text boxes

推荐答案

嗨...


它应该是可能的...请发布你的第一个如何创建的行,它是带有文本框的表格行吗?


亲切的问候
hi ...

it should be possible ... please post how you have your first line created, is it a table-row with textboxes?

kind regards


[HTML]< table id =" tbl"> ;

< tr>< thead>< th> continent< / th>< th> country< / th> < th>经度< / th>

< th>纬度< / th>

< th>时区< / th>

< / thead> < / tr>

< td>< select name =" mcontinent" ID = QUOT; mcontinent" tabindex =" 11">

<选项> --- Selectcontinenet ---< / option>

//来自continenet master

< / select>< / td>


< tr> < td>< select name =" mcountrycode" ID = QUOT; mcountrycode"的tabindex = QUOT 1 QUOT; >

<选项> --- Selectcountry ---< / option>

//从国家/地区主表中选择的选项

< / select>< / td>

< td>< input type =" text"名称= QUOT; mlong" id =" mlong">< / td>

< td>< input type =" text"名称= QUOT; MLAT" ID = QUOT; MLAT" >< / td>

< td>< input type =" text"名称= QUOT;修改时间" ID = QUOT;修改时间" >< / td>

< / tr>

< / table> [/ HTML]
[HTML]<table id="tbl">
<tr><thead><th>continent</th><th>country</th> <th>longitude</th>
<th>latitude</th>
<th>time zone</th>
</thead> </tr>
<td><select name="mcontinent" id="mcontinent" tabindex="11">
<option selected>--- Selectcontinenet ---</option>
//shown from continenet master
</select></td>

<tr> <td><select name="mcountrycode" id="mcountrycode" tabindex="1" >
<option selected>--- Selectcountry ---</option>
//option selected from country master table
</select></td>
<td><input type="text" name="mlong" id="mlong"></td>
<td><input type="text" name="mlat" id="mlat" ></td>
<td><input type="text" name="mtime" id="mtime" ></td>
</tr>
</table>[/HTML]


hi。 ..


查看以下示例:


[HTML]< script type =" text / javascript">

函数add_row(){

var table = document.getElementById(''tbl'');

var row = table.getElementsByTagName( ''tr'')[0];

var new_row = row.cloneNode(true);


table.appendChild(new_row);

}


函数add_row_event(e){

var val = typeof window.event!=''undefined''? window.event.keyCode:e.keyCode;


if(val == 9){

add_row();

}

}

< / script>


< table id =" tbl">

< thead>

< th> continent< / th>

< th> country< / th>

< th>经度< / th>

< th>纬度< / th>

< th>时区< / th>

< / thead>

< tr>

< td>

< select name =" mcontinent" ID = QUOT; mcontinent" tabindex =" 11">

<选择的选项> --- Selectcontinenet ---< / option>

< / select>

< / td>

< td>

< select name =" mcountrycode" ID = QUOT; mcountrycode"的tabindex = QUOT 1 QUOT; >

<选项> --- Selectcountry ---< / option>

< / select>

< / td>

< td>

< input type =" text"名称= QUOT; mlong" id =" mlong">< / td>

< td>

< input type =" text"名称= QUOT; MLAT" ID = QUOT; MLAT" >< / td>

< td>

< input type =" text"名称= QUOT;修改时间" ID = QUOT;修改时间" onkeypress =" add_row_event(event);">

< / td>

< / tr>

< /表>

[/ HTML]

亲切的问候
hi ...

have a look at the following example:

[HTML]<script type="text/javascript">
function add_row() {
var table = document.getElementById(''tbl'');
var row = table.getElementsByTagName(''tr'')[0];
var new_row = row.cloneNode(true);

table.appendChild(new_row);
}

function add_row_event(e) {
var val = typeof window.event != ''undefined'' ? window.event.keyCode : e.keyCode;

if (val == 9) {
add_row();
}
}
</script>

<table id="tbl">
<thead>
<th>continent</th>
<th>country</th>
<th>longitude</th>
<th>latitude</th>
<th>time zone</th>
</thead>
<tr>
<td>
<select name="mcontinent" id="mcontinent" tabindex="11">
<option selected>--- Selectcontinenet ---</option>
</select>
</td>
<td>
<select name="mcountrycode" id="mcountrycode" tabindex="1" >
<option selected>--- Selectcountry ---</option>
</select>
</td>
<td>
<input type="text" name="mlong" id="mlong"></td>
<td>
<input type="text" name="mlat" id="mlat" ></td>
<td>
<input type="text" name="mtime" id="mtime" onkeypress="add_row_event(event);">
</td>
</tr>
</table>
[/HTML]
kind regards


这篇关于用于创建行的Tab键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆