Changeset 16345
- Timestamp:
- 05/27/13 19:06:23 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
schedule/function/SplitDelete.php
r16276 r16345 1 1 <script type="text/javascript"> 2 2 $(document).ready(function(){ 3 var timeValue; 4 var meas; 5 var meas2; 3 6 var cnt=2; 4 7 var table = document.createElement("table"); … … 14 17 input.setAttribute("max","24"), 15 18 input.setAttribute("min","1"), 16 input.setAttribute("required") 19 input.setAttribute("required",true) 20 17 21 ) 18 22 var td=document.createElement('td'); … … 69 73 input.setAttribute('type','text'), 70 74 input.setAttribute('id','txtData1') 75 71 76 72 77 ); … … 80 85 button.onclick= function() 81 86 { 87 meas = "name"; meas2 = "time"; 88 timeValue = ""; 82 89 split1(); 90 91 83 92 } 84 93 ); … … 90 99 button.onclick=function(){ 91 100 $('#table2').remove(); 101 } 102 ); 103 td4.appendChild( 104 button=document.createElement('input'), 105 button.setAttribute('type','button'), 106 button.setAttribute('value','+Measurement'), 107 button.setAttribute('id','btnMeasurement'), 108 button.onclick=function(){ 109 110 if($('#Time1').val() != ""){ timeValue = $('#Time1').val(); meas = "disabled"; meas2 = true; split1(); }else{ alert("please enter value for time to add measurement"); } 92 111 } 93 112 ); … … 116 135 input.setAttribute("max","24"), 117 136 input.setAttribute("min","1"), 118 input.setAttribute("required" )137 input.setAttribute("required",true) 119 138 ) 120 139 var td=document.createElement('td'); … … 179 198 button.onclick= function() 180 199 { 200 meas = "name"; meas2 = "time"; 201 timeValue = ""; 181 202 split(); 203 182 204 } 183 205 ); … … 190 212 $('#table1').remove(); 191 213 214 } 215 ); 216 td4.appendChild( 217 button=document.createElement('input'), 218 button.setAttribute('type','button'), 219 button.setAttribute('value','+Measurement'), 220 button.setAttribute('id','btnMeasurement'), 221 button.onclick=function(){ 222 223 224 225 if($('#Time2').val() != ""){ timeValue = $('#Time2').val(); meas = "disabled"; meas2 = true; split(); }else{ alert("please enter value for time to add measurement"); } 226 192 227 } 193 228 ); … … 200 235 table.appendChild(tr); 201 236 $('#TableH').append(table); 237 var meas; 238 var timeValue; 202 239 203 240 function split() 204 241 { 242 if(cnt <= 10){ 205 243 cnt++; 206 244 var table = document.createElement("table"); … … 210 248 tr.setAttribute('id',''); 211 249 tr.setAttribute('class',''); 250 212 251 var td3=document.createElement('td'); 213 252 td3.setAttribute('style','border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;'); … … 218 257 input.setAttribute("max","24"), 219 258 input.setAttribute("min","1"), 220 input.setAttribute("required") 221 ) 259 input.setAttribute("required",true), 260 input.setAttribute(meas,meas2), 261 input.setAttribute("value",timeValue) 262 263 ); 264 222 265 var td=document.createElement('td'); 223 266 td.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px;text-align:center;"); … … 280 323 button.setAttribute('value','Split'), 281 324 button.onclick=function(){ 325 timeValue = ""; 326 meas = "name"; meas2 = "time"; 282 327 split(); 283 328 } … … 293 338 } 294 339 ); 340 td4.appendChild( 341 button=document.createElement('input'), 342 button.setAttribute('type','button'), 343 button.setAttribute('value','+Measurement'), 344 button.setAttribute('id','btnMeasurement'), 345 button.onclick=function(){ 346 if($('#Time'+cnt).val() != ""){ timeValue = $('#Time'+cnt).val(); meas = "disabled"; meas2 = true; split(); }else{ alert("please enter value for time to add measurement"); } 347 } 348 ); 295 349 tr.appendChild(td3); 296 350 tr.appendChild(td1); … … 300 354 tr.appendChild(td4); 301 355 table.appendChild(tr); 302 $('#TableH1').append(table); 356 $('#TableH').append(table); 357 }else{ 358 359 alert(" only 10 sources are allowed! "); 360 361 } 362 303 363 } 304 364 function split1() 305 365 { 366 if(cnt <= 10){ 306 367 cnt++; 307 368 var table = document.createElement("table"); … … 311 372 tr.setAttribute('id',''); 312 373 tr.setAttribute('class',''); 374 313 375 var td3=document.createElement('td'); 314 376 td3.setAttribute('style','border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;'); … … 319 381 input.setAttribute("max","24"), 320 382 input.setAttribute("min","1"), 321 input.setAttribute("required") 322 ) 383 input.setAttribute("required",true), 384 input.setAttribute(meas,meas2), 385 input.setAttribute("value",timeValue) 386 ); 387 323 388 var td=document.createElement('td'); 324 389 td.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px;text-align:center;"); … … 381 446 button.setAttribute('value','Split'), 382 447 button.onclick=function(){ 383 split(); 448 timeValue = ""; 449 meas = "name"; meas2 = "time"; 450 split1(); 384 451 } 385 452 ); … … 393 460 cnt--; 394 461 }); 462 td4.appendChild( 463 button=document.createElement('input'), 464 button.setAttribute('type','button'), 465 button.setAttribute('value','+Measurement'), 466 button.setAttribute('id','btnMeasurement'), 467 button.onclick=function(){ 468 if($('#Time'+cnt).val() != ""){ timeValue = $('#Time'+cnt).val(); meas = "disabled"; meas2 = true; split1(); }else{ alert("please enter value for time to add measurement"); } 469 470 471 } 472 ); 395 473 tr.appendChild(td3); 396 474 tr.appendChild(td1); … … 401 479 table.appendChild(tr); 402 480 $('#TableH1').append(table); 481 }else{ 482 483 alert(" only 10 sources are allowed! "); 403 484 } 485 } 486 404 487 }); 405 488 </script>
Note:
See TracChangeset
for help on using the changeset viewer.