KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

Minor Syntax Problem...

 
Post new topic   Reply to topic    KS-Soft Forum Index -> Reports
View previous topic :: View next topic  
Author Message
gjones



Joined: 18 Nov 2005
Posts: 5
Location: Los Angeles, CA

PostPosted: Wed Feb 01, 2006 8:36 pm    Post subject: Minor Syntax Problem... Reply with quote

Hopefully minor, that is...

I'm using a custom HTML report with the showinfo() function imbedded into a script line that makes sure the hostname displays in upper case and changes the button colors if it has been up less than 99% of the last day.

Problem is, the buttons don't display anything when clicked on in "Good" or "Good99" status. "Bad" and "Acknowledged work properly. It must be a syntax problem with the way I'm using the escape character, but after an hour I still haven't got it to work.

Test Items (Good):
Code:
<SCRIPT type="text/javascript">
  var HN = "%CommentLine1%";
  HN = HN.toUpperCase();
  if (%PassedCnt%/%TotalTests%>0.99) document.write("<input type=button class=Good99 value= "+HN+" onclick=\"showinfo('Test name: \t%TestName% \nStatus: \t\t%Status% \nRecurrences: \t%Recurrences% \nReply: \t\t%Reply% \nUp Time: \t%AliveTime%')\">");
  else document.write("<input type=button class=Good00 value= "+HN+" onclick=\"showinfo('Test name: \t%TestName% \nStatus: \t\t%Status% \nRecurrences: \t%Recurrences% \nReply: \t\t%Reply% \nUp Time: \t%AliveTime%')\">");
--></script>

Produces the following HTML:

Code:
<SCRIPT type="text/javascript">
  var HN = "LDAPC78";
  HN = HN.toUpperCase();
  if (132/132>0.99) document.write("<input type=button class=Good99 value= "+HN+" onclick=\"showinfo('Test name: \tLDAPC78

Image Workstation \nStatus: \t\tHost is alive \nRecurrences: \t2330 \nReply: \t\t31 ms \nUp Time: \t22:00:39')\">");
  else document.write("<input type=button class=Good00 value= "+HN+" onclick=\"showinfo('Test name: \tLDAPC78 Image Workstation

\nStatus: \t\tHost is alive \nRecurrences: \t2330 \nReply: \t\t31 ms \nUp Time: \t22:00:39')\">");
--></script>


I would appreciate the help as we use the popup info to identify the time of the failure so we know which processes have to be rerun.

Thanks -
Back to top
View user's profile Send private message MSN Messenger
Yoorix



Joined: 14 Dec 2005
Posts: 177

PostPosted: Thu Feb 02, 2006 6:37 am    Post subject: Reply with quote

I think you should to protect slash in special characters like "\n","\t". Try to substitute "\n" with "\\n", "\t" with "\\t" and so on.
I have written sample code and ot works!

Regards,
Yoorix
Back to top
View user's profile Send private message
gjones



Joined: 18 Nov 2005
Posts: 5
Location: Los Angeles, CA

PostPosted: Fri Feb 24, 2006 4:18 pm    Post subject: Yes! Reply with quote

Thank you, kind sir.

You were 100% correct. Our buttons all work perfectly now.
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> Reports All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

KS-Soft Forum Index