Trying this question again, trying to get values from javascript field

Ok I am going to try this again, I need to get the information from the field answer_ docQuestion.UniversalID , I have created an agent to run on the submit of the form but that does not get ran and I am not sure how to get the values from the field so that I can check them against the correct answers.

agent that creates the questions :

If sQuestionInputType = "MC" Then  ' multiple choice

		

		Forall answers In vQuestionKeyword

		‘	Call rtQuestionBody.appendText({<input type="} & "radio" & {"name="answer}& Cstr(j)  & {"value=} &answers &  {>})

			Call rtQuestionBody.appendText({<input type="} & "radio" & {" name="answer_} & docQuestion.UniversalID & {" value=} & answers & {>})

			Call rtQuestionBody.appendText(answers)

			Call rtQuestionBody.AppendText({<br>})

		End Forall

		

	Else ' radio button

		Call rtQuestionbody.appendText({<table width="150" border="0" cellpadding=0 cellspacing=0><tr><td>&nbsp</td>})

		

		Forall options In vMatOption

			Call rtQuestionBody.AppendText({<td>})

			Call rtQuestionBody.appendText(options)

			Call rtQuestionBody.AppendText({</td>})

		‘	Call rtQuestionBody.AppendText({<td><input type="radio" name="answer} &Cstr(j) & {"value=} & options &  {></td>})	

			Call rtQuestionBody.appendText({<td><input type="} & "radio" & {" name="answer_} & docQuestion.UniversalID & {" value=} & options & {></td>})

			

		End Forall

agent that is ran on submit:

Dim s As NotesSession

Dim context As NotesDocument

Dim thisDb As NotesDatabase

Dim requestContent As String

Dim answerArray As Variant



Set s = New NotesSession

Set context = s.DocumentContext

Set thisDb = s.CurrentDatabase



requestContent = context.GetItemValue("Request_Content")(0)

answerArray = Split(requestContent, "&")

docMain.UserAnwsers = context.GetItemValue("Request_Content")(0)

thanks

p.

Subject: Trying this question again, trying to get values from javascript field

How do you submit your form? What’s shown on the server console (or server log, if you don’t have access to the console, which you definitely should have)) when the agent fails to run?

Subject: RE: Trying this question again, trying to get values from javascript field

I use now the WebQuerysave event… the agent runs as I can see the mesbox in the log db. but the Request_Content field is empty, I tought that the data would endup in that field… any idea how I can send the data to that field Request_Content ?

Dim s As NotesSession

Dim context As NotesDocument

Dim thisDb As NotesDatabase

Dim docMain As NotesDocument

Dim requestContent As String

Dim answerArray As Variant

Msgbox ">>>>>>>>>>>>>>1"

Set s = New NotesSession

Set context = s.DocumentContext

Set thisDb = s.CurrentDatabase

Msgbox ">>>>>>>>>>>>>>2"

requestContent = context.GetItemValue("Request_Content")(0)

answerArray = Split(requestContent, "&")



context.UserAnwsers = context.GetItemValue("Request_Content")(0)

thanks

p.

Subject: RE: Trying this question again, trying to get values from javascript field

Let me repeat my question: How do you submit your form?

This has nothing to do with WebQuerySave or form action agent. It’s about if you use

  • an input of type submit (pass-through HTML)

  • a JavaScript button like this.form.submit()

  • a button with @Commands

The latter will not work with your custom form.