Web displays

Questions, problems, and other issues for Ascendis Caller ID that aren't covered by the other forums.
Post Reply
samsungpower
Posts: 49
Joined: Tue May 22, 2012 4:40 pm

Web displays

Post by samsungpower »

Is their a way to have a clickable popup window to display some of the action codes like ###Name### and ###Address### for the table chart on the webpage areas ( Contacts).

I try to play around with some java scripts and it would bring up a popup windows but doesn't display contacts information. If I added all the information I would like to be able to see using the web contacts table chart, the chart is so big and cuttered. when I use the following code it pops up and says "out of area" and you see, I use the bing map code below it and it transfers the data perfect for that.
If it's workable I rather have a text label link than a "button" value link.

I hope this displays proper in the forum with the

Code: Select all

 because the preview button would not display my post before Submit it to you.

[code]
<HTML>
 <HEADER>
  <TITLE>
   Cow Head Ambulance Inc. - Contacts
  </TITLE>
 </HEADER>
 <BODY>
  <navigation>
<br>
<p>You can click on any of the "Column Titles" to organize that field.<br>Click on any "Local Call Back Script" = map location.</p>
<h3><a>Home</a> | <a>Mobile Users</a>
  <br>
  <data>

 <br>
      <table>
   <TBODY>
     <TR>
     <TH> 
      <A>Display Number</A>
     </TH>
     <TH>
      <A>Raw Name</A>
     </TH>
     <TH>
      <A>First Name</A>
     </TH>
     <TH>
      <A>Last Name</A>
     </TH>
     <TH>
      <A>More Information</A>
     </TH>
     <TH>
      <A>Last Time Called</A>
     </TH>
     <TH>Action/Map</A>
    </TR>

    ###CALLERS###
     <TR>
     <TD>###DisplayNumber###</TD>
     <TD>###RawName###</TD>
     <TD>###FirstName###</TD>
     <TD>###LastName###</TD>
     <TD><input></TD>
     <TD>###LastCalled###</TD>
     <TD><a>###ActionName###</font></a></TD>
     </TR>
   
      <script>
function openWin()
{
myWindow=window.open('','','width=400,height=200');
myWindow.document.write("<p>###Name###</p>");
myWindow.document.write("<p>###Address###</p>");
myWindow.focus();
}
</script>    

    ###END###

   </TBODY>
  </TABLE>
 </BODY>

<p>Copyright © 2012-2013. All Rights Reserved.</p>
</HTML>
&#91;/code&#93;
samsungpower
Posts: 49
Joined: Tue May 22, 2012 4:40 pm

Preview ??

Post by samsungpower »

I try it again and still would not let me post all my code ( it doesn't like copyright phrase ) and now it's adds the rest of the code in the input tag

should read

Code: Select all

<HTML>
 <HEADER>
  <TITLE>
   Cow Head Ambulance Inc. - Contacts
  </TITLE>
 </HEADER>
 <BODY>
  <!-- navigation -->
<br>
<p>You can click on any of the "Column Titles" to organize that field.<br>Click on any "Local Call Back Script" = map location.</p>
<h3><a href="/index.html">Home</a> | <a href="/contact2.html">Mobile Users</a>
  <br>
  <!-- data -->

 <br>
      <table width="100%" cellspacing="1" cellpadding="6" border="1px" style="empty-cells&#58; show" align="center">
   <TBODY>
     <TR>
     <TH scope="col"> 
      <A href="/contacts.html?sortColumn=DisplayNumber">Display Number</A>
     </TH>
     <TH scope="col">
      <A href="/contacts.html?sortColumn=RawName">Raw Name</A>
     </TH>
     <TH scope="col">
      <A href="/contacts.html?sortColumn=FirstName">First Name</A>
     </TH>
     <TH scope="col">
      <A href="/contacts.html?sortColumn=LastName">Last Name</A>
     </TH>
     <TH scope="col">
      <A href="/contacts.html?sortColumn=City">More Information</A>
     </TH>
     <TH scope="col">
      <A href="/contacts.html?sortColumn=LastCalled">Last Time Called</A>
     </TH>
     <TH scope="col">Action/Map</A>
    </TR>

    ###CALLERS###
     <TR bgcolor="###ALTERNATECOLOR###">
     <TD>###DisplayNumber###</TD>
     <TD>###RawName###</TD>
     <TD>###FirstName###</TD>
     <TD>###LastName###</TD>
     <TD><input type="button" value="More Infor." onclick="openWin&#40;&#41;" /></TD>
     <TD>###LastCalled###</TD>
     <TD><a href="http&#58;//www.bing.com/maps/?v=2&cp=###County###&lvl=17&dir=0&sty=h&sp=&where1=###Speakname###"target="_blank">###ActionName###</font></a></TD>
     </TR>
   
      <script>
function openWin&#40;&#41;
&#123;
myWindow=window.open&#40;'','','width=400,height=200'&#41;;
myWindow.document.write&#40;"<p>###Name###</p>"&#41;;
myWindow.document.write&#40;"<p>###Address###</p>"&#41;;
myWindow.focus&#40;&#41;;
&#125;
</script>    

    ###END###
   </TBODY>
  </TABLE>
 </BODY>

</HTML>
Bill Root
Site Admin
Posts: 1025
Joined: Mon Jan 19, 2004 1:29 pm
Location: Perrysburg, OH
Contact:

Re: Web displays

Post by Bill Root »

Hi samsungpower,

JavaScript has a function named "alert" to display a message in a popup window:
http://www.w3schools.com/js/js_popup.asp

In order to use it in the call loop, however, you need to define the JavaScript function (you named yours "openWin"; I named mine "details") outside the call loop and pass in the call details.

Also, supposedly it is better to use buttons if a link isn't going anywhere:
http://stackoverflow.com/questions/1348 ... criptvoid0

I included both techniques below; you can choose which best meets your needs.

Here is your adapted code:

Code: Select all

<HTML>
 <HEADER>
  <TITLE>
   Cow Head Ambulance Inc. - Contacts
  </TITLE>
  <script>
    function details&#40;name, address&#41;
    &#123;
      alert&#40;name + "\r\n" + address&#41;;
    &#125;
  </script>   
 </HEADER>
 
 <BODY>
  <!-- navigation -->
<br>
<p>You can click on any of the "Column Titles" to organize that field.<br>Click on any "Local Call Back Script" = map location.</p>
<h3><a href="/index.html">Home</a> | <a href="/contact2.html">Mobile Users</a>
  <br>
  <!-- data -->

 <br>
      <table width="100%" cellspacing="1" cellpadding="6" border="1px" style="empty-cells&#58; show" align="center">
   <TBODY>
     <TR>
     <TH scope="col">
      <A href="/contacts.html?sortColumn=DisplayNumber">Display Number</A>
     </TH>
     <TH scope="col">
      <A href="/contacts.html?sortColumn=RawName">Raw Name</A>
     </TH>
     <TH scope="col">
      <A href="/contacts.html?sortColumn=FirstName">First Name</A>
     </TH>
     <TH scope="col">
      <A href="/contacts.html?sortColumn=LastName">Last Name</A>
     </TH>
     <TH scope="col">
      <A href="/contacts.html?sortColumn=City">More Information</A>
     </TH>
     <TH scope="col">
      <A href="/contacts.html?sortColumn=LastCalled">Last Time Called</A>
     </TH>
     <TH scope="col">Action/Map</A>
    </TR>

    ###CALLERS###
     <TR bgcolor="###ALTERNATECOLOR###">
     <TD>###DisplayNumber###</TD>
     <TD>###RawName###</TD>
     <TD>###FirstName###</TD>
     <TD>###LastName###</TD>
     <TD><input type="button" value="More Infor." onclick="details&#40;'###DisplayName###', '###Address###'&#41;" /></TD>
     <TD><a href="javascript&#58;void&#40;0&#41;" onclick="details&#40;'###DisplayName###', '###Address###'&#41;">Details</a></TD>
     <TD>###LastCalled###</TD>
     <TD><a href="http&#58;//www.bing.com/maps/?v=2&cp=###County###&lvl=17&dir=0&sty=h&sp=&where1=###Speakname###"target="_blank">###ActionName###</font></a></TD>
     </TR>
    ###END###
   </TBODY>
  </TABLE>
 </BODY>

</HTML> 

Finest regards,
Bill Root
Ascendis Software LLC
samsungpower
Posts: 49
Joined: Tue May 22, 2012 4:40 pm

working not working

Post by samsungpower »

Hi Bill, thanks for the fast reply.

So I though I would customize it and add some more information to the alert box. It took me a little time to figure what the "\r\n" does in the

Code: Select all

alert&#40;name + "\r\n" + address&#41;;
I believe it gives us a return and new line in our message box.
So I started to add so more lines and message to the alert box, but the first problem is it will not accept ###number### as a field, it comes up and says ERROR 500 Field 'number' not found , so I when to one of you examples one_call.html and it uses the field 'number' and works? I wanted to make sure I didn't to a type error so I recopy the code once again and substitute the 'address'
with 'number' instead and still does not work.

The second problem is it does not bring up the alert box with all my contacts. Once again I recopy the code to make it back to the original and
still does not work on all contacts, I check the contacts data base with the ones that work and ones that don't work and I see no reason why they not displaying the information. All information is enter in the same way. Any Ideas?
Bill Root
Site Admin
Posts: 1025
Joined: Mon Jan 19, 2004 1:29 pm
Location: Perrysburg, OH
Contact:

Re: working not working

Post by Bill Root »

samsungpower wrote:So I though I would customize it and add some more information to the alert box. It took me a little time to figure what the "\r\n" does in the

Code: Select all

alert&#40;name + "\r\n" + address&#41;;
I believe it gives us a return and new line in our message box.
Yes, that's correct. You can find information on JavaScript all over the internet. Your browser is running the JavaScript code; Ascendis Caller ID has nothing to do with it.
So I started to add so more lines and message to the alert box, but the first problem is it will not accept ###number### as a field, it comes up and says ERROR 500 Field 'number' not found , so I when to one of you examples one_call.html and it uses the field 'number' and works? I wanted to make sure I didn't to a type error so I recopy the code once again and substitute the 'address'
with 'number' instead and still does not work.
The web page you're working on shows a list of contacts. In the version you're using, ###Number### doesn't work for contacts. You need to use ###DisplayNumber### instead. For a list of valid tags, please see the "Web Server Customization" topic in the help, or
http://ascendis.com/callerid/help/web_s ... zation.php

That said, since ###Number### works for calls, it should work for contacts, and the next beta version will support it.

The second problem is it does not bring up the alert box with all my contacts. Once again I recopy the code to make it back to the original and
still does not work on all contacts, I check the contacts data base with the ones that work and ones that don't work and I see no reason why they not displaying the information. All information is enter in the same way. Any Ideas?
Without seeing the code, I don't know what the problem is. You can post the code, or you can look at the web page source from the browser (different browsers put the command in different places) to see the final HTML code after Ascendis Caller ID processes it. That might provide enough information for you to figure it out.


Finest regards,
Bill Root
samsungpower
Posts: 49
Joined: Tue May 22, 2012 4:40 pm

Alert Box

Post by samsungpower »

Thanks for infor. about the number, you I just figure out it had to be DisplayNumber to work but you were to fast responding before I could post it.

I try to explain my problem. I am using the code you provide to me

Code: Select all

<HTML> 
 <HEADER> 
  <TITLE> 
   Cow Head Ambulance Inc. - Contacts 
  </TITLE> 
  <script> 
    function details&#40;name, address&#41; 
    &#123; 
      alert&#40;name + "\r\n" + address&#41;; 
    &#125; 
  </script>    
 </HEADER> 
  
 <BODY> 
  <!-- navigation --> 
<br> 
<p>You can click on any of the "Column Titles" to organize that field.<br>Click on any "Local Call Back Script" = map location.</p>
<h3><a href="/index.html">Home</a> | <a href="/contact2.html">Mobile Users</a> 
  <br> 
  <!-- data --> 

 <br> 
      <table width="100%" cellspacing="1" cellpadding="6" border="1px" style="empty-cells&#58; show" align="center"> 
   <TBODY> 
     <TR> 
     <TH scope="col"> 
      <A href="/contacts.html?sortColumn=DisplayNumber">Display Number</A> 
     </TH> 
     <TH scope="col"> 
      <A href="/contacts.html?sortColumn=RawName">Raw Name</A> 
     </TH> 
     <TH scope="col"> 
      <A href="/contacts.html?sortColumn=FirstName">First Name</A> 
     </TH> 
     <TH scope="col"> 
      <A href="/contacts.html?sortColumn=LastName">Last Name</A> 
     </TH> 
     <TH scope="col"> 
      <A href="/contacts.html?sortColumn=City">More Information</A> 
     </TH> 
     <TH scope="col"> 
      <A href="/contacts.html?sortColumn=LastCalled">Last Time Called</A> 
     </TH> 
     <TH scope="col">Action/Map</A> 
    </TR> 

    ###CALLERS### 
     <TR bgcolor="###ALTERNATECOLOR###"> 
     <TD>###DisplayNumber###</TD> 
     <TD>###RawName###</TD> 
     <TD>###FirstName###</TD> 
     <TD>###LastName###</TD>  
     <TD><a href="javascript&#58;void&#40;0&#41;" onclick="details&#40;'###DisplayName###', '###Address###'&#41;">Details</a></TD> 
     <TD>###LastCalled###</TD> 
     <TD><a href="http&#58;//www.bing.com/maps/?v=2&cp=###County###&lvl=17&dir=0&sty=h&sp=&where1=###Speakname###"target="_blank">###ActionName###</font></a></TD> 
     </TR> 
    ###END### 
   </TBODY> 
  </TABLE> 
 </BODY> 

</HTML>
But the problem is when I click on "Details" to bring up the alert box sometimes nothing happens no information is display or no popup alert box.

I use Safari and firefox and has the same results no Alert Box popup I copy a section of the http source code the first person information will popup the alert box but the second does not.

Code: Select all

     <TR bgcolor="#FFFFFF">
     <TD>1 &#40;xxx&#41; xxx-xxxx</TD> 
     <TD></TD> 
     <TD>Maisie</TD> 
     <TD>Blanchard</TD> 
     <TD><a href="javascript&#58;void&#40;0&#41;" onclick="details&#40;'Maisie Blanchard', '1 &#40;xxx&#41; xxx-xxxx', 'Sports Av'&#41;">Details</a></TD> 
     <TD></TD> 
     <TD><a href="http&#58;//www.bing.com/maps/?v=2&cp=&lvl=17&dir=0&sty=h&sp=&where1=*** Unknow Location Canada  ***"target="_blank">Default</font></a></TD> 
     </TR> 
     
     <TR bgcolor="#CCCCFF">
     <TD>1 &#40;xxx&#41; xxx-xxxx</TD> 
     <TD></TD> 
     <TD>Melvin</TD> 
     <TD>Blanchard</TD> 
     <TD><a href="javascript&#58;void&#40;0&#41;" onclick="details&#40;'Melvin Blanchard', '1 &#40;xxx&#41; xxx-xxxx', 'Keough's Bend'&#41;">Details</a></TD> 
     <TD></TD> 
     <TD><a href="http&#58;//www.bing.com/maps/?v=2&cp=&lvl=17&dir=0&sty=h&sp=&where1=*** Unknow Location Canada  ***"target="_blank">Default</font></a></TD> 
     </TR>

It looks like the program is work and transferring the data to http file but the second example does not even have a popup box happening. I click but nothing happens?
Bill Root
Site Admin
Posts: 1025
Joined: Mon Jan 19, 2004 1:29 pm
Location: Perrysburg, OH
Contact:

Re: Alert Box

Post by Bill Root »

The problem is the apostrophe in "Keough's Bend". Since we're using an apostrophe to delimit it, the embedded apostrophe causes a problem.

We're already using double quotes to delimit the onClick code, but we can replace the apostrophes around "Keough's Bend" (and the other bits, if needed) with ":

Code: Select all

     <TR bgcolor="#CCCCFF">
     <TD>1 &#40;xxx&#41; xxx-xxxx</TD>
     <TD></TD>
     <TD>Melvin</TD>
     <TD>Blanchard</TD>
     <TD><a href="javascript&#58;void&#40;0&#41;" onclick="details&#40;'Melvin Blanchard', '1 &#40;xxx&#41; xxx-xxxx', "Keough's Bend"&#41;">Details</a></TD>
     <TD></TD>
     <TD><a href="http&#58;//www.bing.com/maps/?v=2&cp=&lvl=17&dir=0&sty=h&sp=&where1=*** Unknow Location Canada  ***"target="_blank">Default</font></a></TD>
     </TR>
You'll have to make the above change in the template, of course. Does that fix it?


Finest regards,
Bill Root
Ascendis Software LLC
samsungpower
Posts: 49
Joined: Tue May 22, 2012 4:40 pm

Alert Box

Post by samsungpower »

2 Thumbs up, :D Thanks
Post Reply