@@ -15,22 +15,22 @@ <h2><tmpl_var name="list_head_txt"></h2>
1515 < input type ="hidden " name ="server_id " value ="{tmpl_var name='server_id_value'} " />
1616 < tmpl _else >
1717 < label for ="server_id "> {tmpl_var name='server_id_txt'}</ label >
18- < select name ="server_id " id ="server_id " class ="selectInput " onChange =" reloadWebIP() " >
18+ < select name ="server_id " id ="server_id " class ="selectInput ">
1919 {tmpl_var name='server_id'}
2020 </ select >
2121 </ tmpl _if>
2222 </ div >
2323 < div class ="ctrlHolder ">
2424 < label for ="client_group_id "> {tmpl_var name='client_group_id_txt'}</ label >
25- < select name ="client_group_id " id ="client_group_id " class ="selectInput " onChange =" reloadWebIP() " >
25+ < select name ="client_group_id " id ="client_group_id " class ="selectInput ">
2626 {tmpl_var name='client_group_id'}
2727 </ select >
2828 </ div >
2929 </ tmpl _if>
3030 < tmpl _if name ="is_reseller ">
3131 < div class ="ctrlHolder ">
3232 < label for ="client_group_id "> {tmpl_var name='client_group_id_txt'}</ label >
33- < select name ="client_group_id " id ="client_group_id " class ="selectInput " onChange =" reloadWebIP() " >
33+ < select name ="client_group_id " id ="client_group_id " class ="selectInput ">
3434 {tmpl_var name='client_group_id'}
3535 </ select >
3636 </ div >
@@ -133,19 +133,26 @@ <h2><tmpl_var name="list_head_txt"></h2>
133133</ div >
134134< script language ="JavaScript " type ="text/javascript ">
135135 var serverId ;
136+ var clientGroupId = jQuery ( '#client_group_id' ) . val ( ) ;
136137 var serverIdDisabled = jQuery ( '#server_id_disabled' ) . val ( ) ;
137138 if ( serverIdDisabled > 0 ) {
138139 serverId = serverIdDisabled ;
139140 } else {
140141 serverId = jQuery ( '#server_id' ) . val ( ) ;
141142 jQuery ( '#server_id' ) . change ( function ( ) {
142143 serverId = $ ( this ) . val ( ) ;
143- adjustForm ( serverId ) ;
144+ adjustForm ( ) ;
145+ reloadWebIP ( ) ;
144146 } ) ;
145147 }
146- adjustForm ( serverId ) ;
148+ adjustForm ( ) ;
147149
148- function adjustForm ( serverId ) {
150+ jQuery ( '#client_group_id' ) . change ( function ( ) {
151+ clientGroupId = $ ( this ) . val ( ) ;
152+ reloadWebIP ( ) ;
153+ } ) ;
154+
155+ function adjustForm ( ) {
149156 jQuery . getJSON ( 'sites/ajax_get_json.php' + '?' + Math . round ( new Date ( ) . getTime ( ) ) , { server_id : serverId , type : "getservertype" } , function ( data ) {
150157 if ( data . servertype == "nginx" ) {
151158 var selected = jQuery ( '#php' ) . val ( ) ;
@@ -166,8 +173,8 @@ <h2><tmpl_var name="list_head_txt"></h2>
166173 }
167174
168175 function reloadWebIP ( ) {
169- loadOptionInto ( 'ip_address' , 'sites/ajax_get_ip.php?ip_type=IPv4&server_id=' + document . getElementById ( 'server_id' ) . value ) & client_group_id = '+document.getElementById(' client_group_id ' ) . value ) ;
170- loadOptionInto ( 'ipv6_address' , 'sites/ajax_get_ip.php?ip_type=IPv6&server_id=' + document . getElementById ( 'server_id' ) . value ) & client_group_id = '+document.getElementById(' client_group_id ' ) . value ) ;
176+ loadOptionInto ( 'ip_address' , 'sites/ajax_get_ip.php?ip_type=IPv4&server_id=' + serverId + ' &client_group_id='+ clientGroupId ) ;
177+ loadOptionInto ( 'ipv6_address' , 'sites/ajax_get_ip.php?ip_type=IPv6&server_id=' + serverId + ' &client_group_id='+ clientGroupId ) ;
171178 }
172179
173180</ script >
0 commit comments