modal: true, height: 'auto', width: 'auto',
buttons: {
'Ok':function() {
- Contacts.UI.Card.add(';;;;;', '',$('#selectaddressbook_dialog').find('select').val(), true);
+ Contacts.UI.Card.add(';;;;;', '',$('#selectaddressbook_dialog').find('input:checked').val(), true);
$(this).dialog('close');
},
'Cancel':function() { $(this).dialog('close'); }
<div id="selectaddressbook_dialog" title="<?php echo $l->t("Select Address Books"); ?>">
<form>
-<select id="adr_type" name="parameters[ADR][TYPE]" size="1">
- <?php foreach($_['addressbooks'] as $addressbook) { ?>
- <option value="<?php echo $addressbook['id']; ?>"><?php echo $addressbook['name']; ?></option>
+<table>
+ <?php foreach($_['addressbooks'] as $idx => $addressbook) { ?>
+ <tr>
+ <td>
+ <input id="book_<?php echo $addressbook['id']; ?>" name="book" type="radio" value="<?php echo $addressbook['id']; ?>" <?php echo ($idx==0?'checked="checked"':'')?>>
+ </td>
+ <td>
+ <label for="book_<?php echo $addressbook['id']; ?>"><?php echo $addressbook['name']; ?></label>
+ </td>
+ </tr>
<?php } ?>
-</select>
+</table>
</form>
</div>