Problem with JS/Validation

  1. FIrst question is, why will not field i_location work with my validation?2. Second question is, i will only validation field i_totalcost if field i_grade have value Yes selected. How will a do that. I try with If but i think a put it in the wrong place to get i t work.
Place";

}

// make sure a radio button is selected

var radioCheck = false;

for (i = 0; i < document.forms[0].i_grade.length; i++) {

if (document.forms[0].i_grade[i].checked)

radioCheck = true; }

if (!radioCheck) {

theMessage = theMessage + “\n → Incident”;

}

if (document.forms[0].i_OtherLocation.value==“”) {

theMessage = theMessage + “\n → Location”;

}

if (document.forms[0].i_totalcost.value==“”) {

theMessage = theMessage + “\n → Total value”;

}

}

// If no errors, submit the form

if (theMessage == noErrors) {

return true;

} else {

// If errors were found, show alert message

alert(theMessage);

return false;

}

}

// End →

Kind regards

Fredrik

Subject: Problem with JS/Validation

Notes field that are represented as - Another place - SomeLocation SomeOtherLocation

Otherwise, it will look like this:

If you aren’t using value aliases, then you need to check the .text instead of the .value of the selected option.

As for the radio button, there should always be one value checked, and you are setting the radioChecked variable to true if any of the values is checked. The for block should look like this:

for (i = 0; i < document.forms[0].i_grade.length; i++) {

var elem = document.forms[0].i_grade[i];

if (elem.checked && elem.value == “Yes”) radioCheck = true;

}

Subject: Question re: the code in your response

Sorry, complete change in subject, but I noticed something in your post above that I wanted to ask about.

When I have a Notes dialog list field render on the Web, I don’t get the closing tag. I only get:

Is there a trick to getting the server to render the closing tag? Maybe a server setting I can have the admin update? (Currently on 7.0.2 server)

Subject: RE: Question re: the code in your response

Oops – that’s me and my closing-tag anal retentive disorder. Comes from typing the HTML manually in the response. There was an output URL switch (&outputformat=xhtml10 or something very similar to that) that could force the closing tags in some spots, but that just makes application design unweildy. Note that closing tags are not required in HTML on all elements; they’re only required in XHTML.

You can add a DominoCompleteDoctype line to your server’s notes.ini (=2 produces HTML 4.01 strict), but that only affects the doctype declaration line, not the HTML output.

Subject: RE: Problem with JS/Validation

Thanx, it´s helped me.