Revision 318,
1.1 KB
checked in by niltonneto, 16 years ago
(diff) |
Commit feito pelo desenvolvedor (rodrigosouza).
|
-
Property svn:executable set to
*
|
Rev | Line | |
---|
[318] | 1 | (function() |
---|
| 2 | { |
---|
| 3 | // Envio para o PHP |
---|
| 4 | var connection = new IMConnector('instant_messenger/'); |
---|
| 5 | |
---|
| 6 | function getInputs(pDocument) |
---|
| 7 | { |
---|
| 8 | var form = pDocument.forms[0]; |
---|
| 9 | var values = ""; |
---|
| 10 | var field_blank = false; |
---|
| 11 | |
---|
| 12 | for( var i = 0 ; i < form.elements.length; i++ ) |
---|
| 13 | { |
---|
| 14 | |
---|
| 15 | switch(form.elements[i].type) |
---|
| 16 | { |
---|
| 17 | case "text" : |
---|
| 18 | if ( form.elements[i].value != "" ) |
---|
| 19 | values += form.elements[i].id.toUpperCase() + ";" + escape(form.elements[i].value) + "\n"; |
---|
| 20 | else |
---|
| 21 | field_blank = true; |
---|
| 22 | break; |
---|
| 23 | |
---|
| 24 | case "password" : |
---|
| 25 | if ( form.elements[i].value == "" ) |
---|
| 26 | field_blank = true; |
---|
| 27 | break; |
---|
| 28 | } |
---|
| 29 | } |
---|
| 30 | |
---|
| 31 | if(!field_blank) |
---|
| 32 | { |
---|
| 33 | values = values.substring(0,(values.length - 1 )); |
---|
| 34 | connection.go("$this.FileDefine.getParams", "val=" + values); |
---|
| 35 | pDocument.forms[0].submit(); |
---|
| 36 | } |
---|
| 37 | else |
---|
| 38 | { |
---|
| 39 | alert('Informe todos os campos!'); |
---|
| 40 | return false; |
---|
| 41 | } |
---|
| 42 | } |
---|
| 43 | |
---|
| 44 | function sendf() |
---|
| 45 | { |
---|
| 46 | var doc = ( arguments.length == 1) ? arguments[0] : false; |
---|
| 47 | |
---|
| 48 | if( doc ) |
---|
| 49 | getInputs(doc); |
---|
| 50 | } |
---|
| 51 | |
---|
| 52 | function constructScript(){} |
---|
| 53 | |
---|
| 54 | // Dando acesso externo as funções; |
---|
| 55 | constructScript.prototype.sendf = sendf; |
---|
| 56 | window.constructScript = constructScript; |
---|
| 57 | } |
---|
| 58 | )(); |
---|
Note: See
TracBrowser
for help on using the repository browser.