Ausweitung der Klon-Tabelle-Reihen - Funktionen- ändern von Zeilen-ID

Habe ich diese Geige am: http://jsfiddle.net/radi8/EwQUW/33/

Beachten Sie, dass die erste Tabelle definiert ist:

<table class="reference" width="100%" border="1" align=left id="secondaryEmails">
<thead>
    <tr>
        <th width="30%">SelectRow</th>
        <th width="40%">Email</th>
        <th width="30%">Ship Type</th>
    </tr>
</thead>
<tbody>
    <tr id="template" style="display:none">
        <td align="center">
            <input type=radio id="index_" name = "index" value="0">
        </td>
        <td align="center">
            <input type="text" id="email_" name ="email_" value="" size=40>
        </td>
        <td align="center">
            <select style=width:150 id="shipType_" name="shipType_">
                <option value="0" "selected">Both</option>
                <option value="1">Over Road</option>          
                <option value="2">Over Rail</option>
            </select>
        </td>
    </tr>
    <tr>
        <td align="center">
            <input type=radio id="index_2" name = "index" value="2">
        </td>
        <td align="center">
            <input type="text" id="email_2" name ="email_2" value="[email protected]" size=40>
        </td>
        <td align="center">
            <select style=width:150 name="shipType_2" id="shipType_2">
                <option value="0" >Both</option>
                <option value="1" >Over Road</option>
                <option value="2" selected>Over Rail</option>
            </select>
        </td>
    </tr>
</tbody>
<tfoot>
    <tr>
        <th align="center">
            <button id='Add'>Add Row</button>
        </th>
        <th>&nbsp;</th>
        <th align="center">
            <button id='update'>Update</button>
        </th>
    </tr>
</tfoot>

Wenn ich clone die erste Zeile, die ich ändern muß die ID der neuen Zeile, um so etwas wie

<tr id="emlRow_1">

wobei die Zahl der neuen ID der Zeile.

Kann jemand mich leiten, wie dies zu tun?

InformationsquelleAutor radi8 | 2011-08-08
Schreibe einen Kommentar