To read a value of multiple lines of text from a Edit Form or New Form. Assume Comments is the field name
<script language="javascript" type="text/javascript" >
function PreSaveAction()
{
var Comments = getTagFromIdentifierAndTitle("textarea","TextField","Comments");
var CommentsText = RTE_GetEditorDocument(Comments.id);
var CommentsTextValue = CommentsText .body.innerText;
}
function getTagFromIdentifierAndTitle(tagName, identifier, title)
{
var len = identifier.length;
var tags = document.getElementsByTagName(tagName);
for (var i=0; i < tags.length; i++)
{
var tempString = tags[i].id;
if (tags[i].title == title && (identifier == "" || tempString.indexOf(identifier) == tempString.length - len))
{
return tags[i];
}
}
return null;
}
</script>
Additionally, use the following code to read the selected value of a drop down.
var val = $("select[title='ChoiceFieldName']").val();