How to display a document in a field in web browser using agent

hai

any body plese tell me how to display a document in a field in a form opened in a webbrowser…

i have to get the documents in aview and have to display it in a form opened in a “webbrowser” the bottom line is “webenabling the form”

i have explained the scenario below. please have a look at it.

scenario :


  1. i have a form in which i have a field named “content”.

  2. now i want to put a question in the field named “content”

  3. The question is like this

    Is java a language?
    
  4. and also i have choices for the question also

    The choices are a) Yes and  b) No
    
  5. now i have to put the question and the corresponding choices for the question in the field named “content”.

  6. now the toughest part is here !!!

    the form should be shown in "web browser " in which a user will answer the “question” and the “validation” is done by means of “javascript”

  7. Now tell me how i will put the data i.e " the question and the choices " in the field named “content” ?

  8. surely i have to do it by means of an “agent”.

    i can call the agent using “webqueryopen” event and the agent will put the data into the field.

  9. fine now pls tell me what coding goes into the agent “initialize” function ?

  10. i have tried the following codings but it doesnt works…

    dim ss as new notessession

    dim db as notesdatabase

    dim doc as notesdocument

    dim item as notesrichtextitem

    dim question as string

    dim answer as string

    dim final as string

    set db =ss.currentdatabase

    set doc=db.createdocument

    doc.form=“testform” // my form name

    set item=db.createrichtextitem(“content”)

    question = { is java a language?
    }

    answer = {yes
    no
    }

    finalvalue=question + answer

call item.appendtext(“content”,finalvalue)

call doc.save(true,false)

----- the coding… ends here -------

if i use “document context” in the place of “create document” i can put the value in the field without going for "createrichtext item "

but the html tags are apeearing as it is inside the field and

for eg.

               <b> hello </b>

is not converting into bold text and is appearing as it is inside the field.

but i want it to be html formatted…

also i dont want to put the question as typed over the form and by enabling the "pass thru HTML " option to ON.

please help me to overcome the situation.

im very indeed of the same. and i need it very critical.

plese help me out in this … using lotus script.

Subject: how to display a document in a field in web browser using agent.

Start Simply. Your code creates a document when what you want is a FORM for the user to fill in. Saving the form will create the document.

Just code the form as you would for the notes client (add your question as text on the form and a radio button field with options yes and No) and then preview it in the browser. Domino will do all the hard work for you.

Normal input validation works but is not pretty. Search the forum for examples on Javascript validation.

Subject: RE: how to display a document in a field in web browser using agent.

hai Mellisa

the thing you said was fine

but the scenario is different

understand this scenario first

i have a online recruitment system for candidates

so i have to present questions to the candidates according to their skills.

if the candidate is a fresher then i have to put him easy and say some 10 questions

but if the candidate is a expereienced person then i have to put him tough questions and say some 20 questions !

so for every user i will preset the number of questions that i have to present him.

so i will have three fields namely

“subject” , “complexity” , “total questions”

also i have a view named “qbank” in which i will store questions according to the subject , complexity

the subject takes two values namely “java” and “notes”

the complexity will have the values “1”,“2”

now i will have a form in which i will place the above said fields and will generate documents (i.e questions) and put it in the view named(" qbank ")

now according to the skills of each candidate i will get documents by key from the view and will present to ther user(i.e candidate)

so consider

  1. a person named " justin " comes to attend the test he is a experienced guy and he is skilled in “java”

now i want to populate him some"20" questions of category “java” to him in a form .

  1. now say a person named “sally” comes to attend the test she is a “fresher” and she is a java beginner.

so i have to present her some “10” questions of minimum difficulty.

likewise i have to vary the questions according tothe candidate skill.

but ti should be able to acheive this with a single form and by generating th e HTML part alone dynamically using agent.

i think now u should have understood the situation…

so please turn your ideas into this…

and help me out.