Skip to content

Commit

Permalink
suport a textarea
Browse files Browse the repository at this point in the history
  • Loading branch information
joao_neto authored and joao_neto committed Oct 28, 2010
1 parent 3e6f39f commit 5b23ccb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions xsdForm.js
Expand Up @@ -505,8 +505,8 @@ function generateXml(xsdFile, input_to_set) {
var divParent;
var field;
var requiredField;
var div
var divMessageError;
var div;
var divMessageError;
var messageError;
var submitForm = true;
var type;
Expand All @@ -527,7 +527,7 @@ function generateXml(xsdFile, input_to_set) {
// percorre a div que contem o campo
for (var j = 0; j < divParent.childNodes.length; j++) {

if ( divParent.childNodes[j].nodeName == 'INPUT' ) {
if ( divParent.childNodes[j].nodeName == 'INPUT' || divParent.childNodes[j].nodeName == 'TEXTAREA') {
field = divParent.childNodes[j];

} else if ( divParent.childNodes[j].nodeName == 'DIV' && getValueAttributeByName(divParent.childNodes[j], 'name' ) == 'requiredField' ) {
Expand All @@ -549,7 +549,7 @@ function generateXml(xsdFile, input_to_set) {


if ( requiredField == 'true' ) {
if ( field.nodeName == 'INPUT' ) {
if ( field.nodeName == 'INPUT' || field.nodeName == 'TEXTAREA') {
if ( messageError ) {
if ( field.value == '' ) {
submitForm = false;
Expand Down Expand Up @@ -1000,7 +1000,7 @@ function getFormFromNode(namePattern, xml) {
}

function insereValor(nameField,valor) {
if ((getById(nameField).nodeName == "INPUT" && getById(nameField).type == "text") || getById(nameField).nodeName == "SELECT") {
if ((getById(nameField).nodeName == "INPUT" && getById(nameField).type == "text") || getById(nameField).nodeName == "SELECT" || getById(nameField).nodeName == "TEXTAREA") {
getById(nameField).value = valor;
} else if (getById(nameField).type == "checkbox") {
if (valor == 1) {
Expand Down

0 comments on commit 5b23ccb

Please sign in to comment.