Changeset 52
- Timestamp:
- 12/19/07 02:31:14 (4 years ago)
- Files:
-
- efio/efio/fio_suggest.js (modified) (4 diffs)
- efio/efio/fio_user.js (modified) (1 diff)
- efio/efio_and_kladr/index.html (modified) (1 diff)
- efio/index.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
efio/efio/fio_suggest.js
r49 r52 61 61 this.inputs = []; 62 62 this.titles = []; 63 this.correct = null; 63 64 } 64 65 FioGroup.prototype.hideNextInputs = function(c) {} … … 79 80 EFIO_SERVER, req, 80 81 function(result, errors) { 82 oThis.correct = 2; // идет проверка.. 81 83 var err = false; 82 84 if (result) { … … 94 96 } else oThis.inputs[2].textbox.className = ""; 95 97 } 96 if (err) oThis. additionNotify(false);98 if (err) oThis.correct = 0; 97 99 else { 98 100 FioGroup.addNames(req.sname, req.name, req.pname); 99 oThis.additionNotify(true);101 oThis.correct = 1; 100 102 } 101 103 }, 102 104 false 103 105 ); 106 } 107 FioGroup.prototype.setMessage = function(m) { 108 this.message = m; 104 109 } 105 110 FioGroup.addNames = function(sname, name, pname) { … … 117 122 ); 118 123 } 119 FioGroup.prototype.setAdditionCallback = function(fcallback) {120 this.additionNotify = fcallback;121 }122 124 FioGroup.prototype.add = function(c) { 123 125 this.inputs.push(c); efio/efio/fio_user.js
r46 r52 17 17 function initEfio() { 18 18 fioGroup = new FioGroup; 19 fioGroup.check = function() { 20 switch(this.correct) { 21 case 0: this.message.innerHTML = "ошибка"; break; 22 case 1: this.message.innerHTML = "правильно"; break; 23 case 2: this.message.innerHTML = "проверка.."; break; 24 } 25 } 19 26 fioGroup.setFilter(efioFilter); 20 fioGroup.setAdditionCallback(myfunc);21 27 input_0 = document.getElementById("efio_surname"); 22 28 input_1 = document.getElementById("efio_name"); 23 29 input_2 = document.getElementById("efio_patronym"); 24 30 fioGroup.setButton(document.getElementById("efio_button")); 31 fioGroup.setMessage(document.getElementById("message")); 25 32 fioGroup.add(new AutoSuggestControl(input_0, new SurnameSuggestions)); 26 33 fioGroup.add(new AutoSuggestControl(input_1, new NameSuggestions)); 27 34 fioGroup.add(new AutoSuggestControl(input_2, new PatronymSuggestions)); 35 setInterval(function () { fioGroup.check() }, 150); 28 36 } efio/efio_and_kladr/index.html
r46 r52 11 11 12 12 <link type="text/css" href="styles.css" rel="stylesheet" /> 13 <script type="text/javascript">14 EFIO_SERVER = "http://localhost/efio/fio_suggest.php"15 KLADR_SERVER = "http://localhost/kladr/addr_suggest.php"16 </script>17 13 </head> 18 14 <body onload="initEfio();initKladr();"> efio/index.html
r47 r52 19 19 </tr> 20 20 </table> 21 <div id="message"></div> 21 22 </body> 22 23 </html>
