projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix DID selection dropdowns, RT#75901
[freeside.git]
/
httemplate
/
elements
/
select-phonenum.html
diff --git
a/httemplate/elements/select-phonenum.html
b/httemplate/elements/select-phonenum.html
index
dd1b847
..
c9254ad
100644
(file)
--- a/
httemplate/elements/select-phonenum.html
+++ b/
httemplate/elements/select-phonenum.html
@@
-37,10
+37,9
@@
passing the exchange (or region) and
<SCRIPT TYPE="text/javascript">
<SCRIPT TYPE="text/javascript">
- function opt(what,value,text) {
+ function
j
opt(what,value,text) {
var optionName = new Option(text, value, false, false);
var optionName = new Option(text, value, false, false);
- var length = what.length;
- what.options[length] = optionName;
+ what.append(optionName);
}
function <% $opt{'prefix'} %><% $previous %>_changed(what, callback) {
}
function <% $opt{'prefix'} %><% $previous %>_changed(what, callback) {
@@
-58,12
+57,11
@@
passing the exchange (or region) and
var reply = JSON.parse(phonenums);
// blank the current phonenum
var reply = JSON.parse(phonenums);
// blank the current phonenum
- for ( var i = what.form.<% $opt{'prefix'} %>phonenum.length; i >= 0; i-- )
- what.form.<% $opt{'prefix'} %>phonenum.options[i] = null;
+ $('#<% $opt{prefix} %>phonenum').empty;
% if ($opt{empty}) {
if ( what.form.<% $opt{'prefix'} %>phonenum.type != 'select-multiple' ){
% if ($opt{empty}) {
if ( what.form.<% $opt{'prefix'} %>phonenum.type != 'select-multiple' ){
-
opt(what.form.<% $opt{'prefix'} %>phonenum
, '', '<% $opt{empty} %>');
+
jopt($('#<% $opt{'prefix'} %>phonenum')
, '', '<% $opt{empty} %>');
}
% }
}
% }
@@
-73,7
+71,7
@@
passing the exchange (or region) and
var phonenumLabel = phonenumArray[s];
if ( phonenumLabel == "" )
phonenumLabel = '(n/a)';
var phonenumLabel = phonenumArray[s];
if ( phonenumLabel == "" )
phonenumLabel = '(n/a)';
-
opt(what.form.<% $opt{'prefix'} %>phonenum
, phonenumArray[s], phonenumLabel);
+
jopt($('#<% $opt{'prefix'} %>phonenum')
, phonenumArray[s], phonenumLabel);
}
//var phonenumFormLabel = document.getElementById('<% $opt{'prefix'} %>phonenumlabel');
}
//var phonenumFormLabel = document.getElementById('<% $opt{'prefix'} %>phonenumlabel');
@@
-131,11
+129,10
@@
passing the exchange (or region) and
what = document.getElementById('<% $opt{prefix} %>phonenum');
// blank the current phonenum
what = document.getElementById('<% $opt{prefix} %>phonenum');
// blank the current phonenum
- for ( var i = what.form.<% $opt{'prefix'} %>phonenum.length; i >= 0; i-- )
- what.form.<% $opt{'prefix'} %>phonenum.options[i] = null;
+ $('#<% $opt{prefix} %>phonenum').empty;
% if ($opt{empty}) {
% if ($opt{empty}) {
-
opt(what.form.<% $opt{'prefix'} %>phonenum
, '', '<% $opt{empty} %>');
+
jopt($('#<% $opt{'prefix'} %>phonenum')
, '', '<% $opt{empty} %>');
% }
// add the new phonenums
% }
// add the new phonenums
@@
-144,7
+141,7
@@
passing the exchange (or region) and
var phonenumLabel = phonenumArray[s];
if ( phonenumLabel == "" )
phonenumLabel = '(n/a)';
var phonenumLabel = phonenumArray[s];
if ( phonenumLabel == "" )
phonenumLabel = '(n/a)';
-
opt(what.form.<% $opt{'prefix'} %>phonenum
, phonenumArray[s], phonenumLabel);
+
jopt($('#<% $opt{'prefix'} %>phonenum')
, phonenumArray[s], phonenumLabel);
}
what.form.<% $opt{'prefix'} %>phonenum.disabled = '';
}
what.form.<% $opt{'prefix'} %>phonenum.disabled = '';