Mutli value field and javascript

I’m kind of new to javascript and I can’t seem to find the answer for this…

how do I access/write to the elements in a multi value field using javascript? Say, I have a field with five values. I want to access the third value, (maybe check in an if statement of something like that). Also, if I wanted to change the value of the third value in the field, how would I do that with javascript?

If javascript is not really the answer for doing this on the web, what would I use?

Thanks so much!!

Subject: RE: mutli value field and javascript

It depends on the type of field. If you have the form object (say in a variable called frm) then frm.fieldname will return an object (such as a Text object) or an array of objects (e.g. of Radio). These objects have different ways of retrieving the field’s value. If it is Text, you can get a string out and split it into multiple values on the delimiter character. If it’s a Select, you have to look iterate through its options to find which ones are checked. And so on. If you search the internet you can probably find a little subroutine that tests the field type and does this for you.

Sorry if this is more complex than you wanted; Lotus didn’t invent JavaScript.

Subject: RE: mutli value field and javascript

I posted a function here a while back that may help: atGetField() . The function is designed to return an array of values from all editable field types – it assumes a semicolon as the separator for text fields and newline for textareas in the posted version.

Subject: RE: mutli value field and javascript

Andre & Stan,

Thanks a million for both replies!! I will look into soon as the other crazy things that came up are finished. I will post any updates I find as well.

again, thanks!!