'Print'ing javascript in an agent

Hi,

I have an agent which prints to a web browser. Please see the below code:

Print{}

Print {

}

Print {

}

Print {

}

Print |<input type=radio onclick=setJobDetails(| & viewdoc.JB_JobNumber(0) & |“,”| + viewdoc.JB_JobTitle(0) + |"|

Print{}

Now when I see the source for this generated HTML page… I see :

<INPUT
  onclick='setJobDetails("KJS' type=radio < , 009?></TD>

It breaks up the paameter string if it encounters a space in the string. Please help me to work this out.

Thanks in advance.

Subject: 'Print’ing javascript in an agent

The source code you gave seems to not resemble your code. In you LS you have the line

Print |<input type=radio onclick=setJobDetails(| & viewdoc.JB_JobNumber(0) & |“,”| + viewdoc.JB_JobTitle(0) + |"|

but in the source code there is a single quote after onclick=, which doesn’t match. I also wonder, if the order of type and onclick is really mixed up.

But that’s what your problem seems to be all about: proper nesting of quotes and use of tags. Maybe you should first give us a hint what the correct HTML for your input should look like, that would make it a lot easier. Your current code sample doesn’t even include the closing angle bracket of the input tag.

I would also recommend to take the time and add some bits to make your HTML valid. First of all, your first line should be a DOCTYPE declaration. Have a look at the source code of a Domino generated page and copy what’s in there. The exact actual doctype string depends on the server configuration, but it will be a doctype based on HTML 4, and that’s what I’m referring to now.

Next, title tags are mandatory in the head section of a valid HTML page.

The script tag has a required attribute

type=“text/javascript”, which you should include. The lang attribute often found is not required. Btw, while HTML is not so strict about it as e.g. xhtml, it is a good idea to quote all of your attribute values.

Subject: RE: 'Print’ing javascript in an agent

Thanks for your reply. Regarding the missing angular bracket, it is a copy paste error. Sorry about that. But the HTML output is indeed garbled. The single quote has appeared out of nowhere. And it only happens if the parameter string has a space in it.Please let me know if there is some way to handle this.

Subject: RE: 'Print’ing javascript in an agent

Have you tried using @URLEncode on your fields ?

Paul

Subject: RE: 'Print’ing javascript in an agent

What browser - or more precisely what source viewer - did you use? It might just be, that the single quote isn’t really in the source.

Anyway, it would still be helpful to know, how the resulting line is meant to look like. Are there only two parameters to be passed to the function? As displayed, the code is missing the not only the closing angle bracket, but also the round brace. What is copy-paste error, what not?

Also, you add double quotes between the two parameters, but not at the beginning and at the end. Most probably you should encode those quotes anyway. Give us the current code line and an example of what the ouput should be, and we’ll be able to solve it.