By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
462,299 Members | 777 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 462,299 IT Pros & Developers. It's quick & easy.

A design question. Looking for a design solution.

100+
P: 348
Hey everyone,

I lost my internet connection for about 5 months and finally got it back. This is one of the first places I came back to. I have to say that I had a heck of a time finding it because of the name change and facelift. :)

Anyway, good to be back. I have a question that may be more of a design question. If this post doesn't belong here, I appoligize in advance, feel free to move it.

I need to create a form that will be split into 4 squares. Each square will serve as a data view to my backend database. I have created a sample form but it really looks terrible. I used scrolling divs and the scrollbars really take away from the appearance of the form. I enjoy the php programming much better than the design. :)

What I would like to do is to be able to update, insert and delete from all four of these sections all by just the click of the mouse on a certain row.

Does anyone have any suggestions? I am also open to anyone wanting to help out with the design of a few forms using ajax because I have a feeling that you will all say, "use ajax" but I don't program js.

Thanks.

Frank
Jun 12 '08 #1
Share this Question
Share on Google+
9 Replies

100+
P: 310
I cannot help too much. This part of the design is difficult, in particular if it should be cross browser. I have no idea how you can make the design part really look good without getting very complicated.

But I will say that you should get into Javascript. Start now. It will be difficult to make good interactive pages without it. You don't need too much at the start, just learn about what html elements can take on the "onclick" or "ondblclick" events (just about all of them, actually, including a TD cell or a TR row in a table, what I use a lot!) and how to tie that event to a small Javascript function that you put on the page. You can go far with just this much. You can make it so that some function is called when the user either clicks or doubleclicks on a cell or row in a table or on an image, or when the user enters or leaves an input field, etc.
Jun 12 '08 #2

100+
P: 348
fjm
Hey Coolsti, thanks for the reply. I will take your advice on learning js. It just gets overwhelming sometimes, I mean, the learning never stops man. :)

The UI does not need to be cross browser at all. As long as it functions in M$ and Moz I will be OK.

I was going to post another question regarding that exact very thing you touched on.. About the possibility of clicking on a row of data and having an action take place like open another js window or whatever. Thats cool.

Thanks!
Jun 12 '08 #3

100+
P: 310
I basically have learned all my HTML, CSS, Javascript and PHP working for my current company, when it became obvious they needed a web based database application and I was the only one around with programming experience (start up company, heh heh). I have been learning all along, and using more and more things as I discover them and learn them. So although it all seems overwhelming at first, just take a piece at a time.

I started off putting zillions of buttons on my pages, thinking that a button was the only thing that could be clicked. One day I discovered you can add the onclick, ondblclick and oncontextmenu events to a TD and a TR element on a page and I started improving the design of my pages.

Just take one thing at a time.
Jun 12 '08 #4

100+
P: 348
fjm
Thanks Coolsti. You have inspired me. :) Actually, it comes at a good time because the other day I had to troubleshoot a js code and when I really started to look at it, I noticed that it resembles php a lot!. js and php use a lot of the same syntax and because I know php, I should be able to pick up on js fairly easy I think.

Coolsti, could I trouble you for a small code sample of an ondblclick event? In my mind, I am thinking that I can have a user dblclick on a row of data and then possibly have php process that, whatever that may be.

What I am looking for, or thinking that I want, is, INSTEAD of a hyperlink, have css highlight a row of data and then wherever a user double clicks on that row, process something. Is this possible?

Thanks.

Frank
Jun 12 '08 #5

100+
P: 310
The principles of JS and PHP are the same, so if you understand one you understand a lot of the other, but the syntax is very different, for example where PHP uses the -> for membership but JS uses a period. But once you get a handle on the syntax it will come easy.

What it sounds like you want to do is to have a user click on a table cell or row and then have a PHP script be run in the background (that is, the main page is not refreshed, but a PHP script on the server is asked to do something, perhaps to send data back to update some fields in the main page), and this is totally possible with JS. I am bad to give an example, perhaps, because I use the pre-Ajax method of including a hidden iframe in my page, and using JS to submit a form in this iframe, and using JS in the iframe's resonse to update fields in the main page. Today, however, most people use Ajax (which I never learned yet) which encapsulates all this.

But here is something from my application to show you the use of an onclick in a table row, vastly simplified, and here I show you the client side code which is produced by PHP, but not the PHP that produces this:

Expand|Select|Wrap|Line Numbers
  1.  
  2. ...
  3.  
  4. <input type="hidden" name="itemid" value="" />
  5. <table>
  6. <tr class="r1" onmouseover="rsMouseOver(this) onmouseout="rsMouseOut(this,'r2') ondblclick="openItem(24)" >
  7. <td>Contents of a cell</td>
  8. <td>Contents of another cell</td>
  9. </tr>
  10. </table>
  11. ....
  12. <script>
  13. function rsMouseOver(row) {
  14.    // change class to "rover" which changes background color
  15.     row.className = 'rover';
  16. }
  17. function rsMouseOut(row,c) {
  18.    // change row class back to original, giving original background color
  19.     row.className=c;
  20. }
  21. function openItem(n) {
  22.    // n is the ID of the item number to be opened, corresponds to item
  23.    // shown in the row that is clicked on
  24.    document.form1.itemid.value = n;
  25.    // other functions which tell which script to call on submit are not shown here.
  26.    document.form1.submit();
  27. }
  28. </script>
  29.  
  30. ...
  31.  
  32.  
This just shows how it might look to include an ondblclick, an onmouseover and an onmouseout event in a TR tag. This is code from a search results table, where every I alternate the background color of the table rows, and when the user places the mouse over a row, the background color changes to a yellow to highlight it. When the user moves the mouse away from the row, the color is returned to the original. I do this by coding the original class of the row as an argument to the onmouseout function for each row.

The ondblclick example here does not perform a background query, but rather submits the page to return with a new page showing a view of the item that corresponds to the row that the user doubleclicked on. The item ID is also hardcoded as an argument to the ondblclick function for each row, all this is done by the PHP that produced this page. If I was instead to perform a background query, I would include in the page a hidden iframe with its own form, and the ondblclick function would set whatever parameters in that form are needed (for the POST array), and then submit the iframe. But that is another example.

Hope I have helped.
Jun 13 '08 #6

100+
P: 348
fjm
Hey Coolsti, yes, you have helped me tremendously. Since I read your last post, I have been busy looking for a solution, code sample or anything. I managed to come up with the perfect little ondblclick event and was really happy until I tested it in FF, only to discover that it doesn't work. Well.. more searching brought me to activewidgets' website where I played with the controls for some time. It looks like that is exactly what I am after.

I have downloaded a few different controls in AJAX that will do what I need but I can't figure them out. I am trying to rely on my php knowledge on instantiation which has helped a little but I am still in the dark.

You're right about the syntax being different. I already figured out that in js this.object is the same as $this->object in php. Minor differences but none the less, time consuming.

Thanks for the code sample and all of the help. :)

I suppose I will have to try and figure out how to get these controls to work. Already, I have wasted a day and I am really not any further ahead than I was before.

Frank
Jun 13 '08 #7

100+
P: 310
I know what you are going through. I usually avoid using any controls or things made by other people, because they are too difficult to understand, or too bulky (they try to do everything for every case that can arise) or the negatively affect other things I have on a page.

An example of this is when I wanted to find some JS to make tooltips to give hints about certain fields on my pages. I found a good one that worked well enough, but it added a huge number of lines and functions of JS to my pages, and the manner in which it was implemented broke my other JS code for mouse overs. I wound up getting the basic idea how something like this is implemented (mostly using it as example to learn how the timers work in JS) and made my own very functional but much more streamlined version.

I am surprised you have problems with Firefox. All the things that I have written work for both Firefox and IE.

For doing background stuff with iframes, I just put a hidden iframe on my page, sort of with this code:

Expand|Select|Wrap|Line Numbers
  1. <iframe src="ifrm.php" name="prtifrm" id="prtifrm" scrolling="no" frameborder="0" width="0" height="0"></iframe>
  2.  
where the ifrm.php script when initially called will just place something like this in the iframe:

Expand|Select|Wrap|Line Numbers
  1.     <form name="ifrmform" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
  2.     <input type="hidden" name="param1" value="" >
  3.     <input type="hidden" name="param2" value="" >
  4.     <input type="hidden" name="param3" value="" >
  5.     <input type="hidden" name="param4" value="" >
  6.     <input type="hidden" name="param5" value="" >
  7.     <input type="hidden" name="param6" value="" >
  8.     <input type="hidden" name="param7" value="" >
  9.     <input type="hidden" name="param8" value="" >
  10.     <input type="hidden" name="action" value="" >
  11.     </form>
  12.  
This is just a form, and I have given myself 9 parameters I can set from a JS function on the main page, which will be POST'ed to ifrm.php when the iframe is submtted. The parameter named "action" I use in a switch statement in ifrm.php to run the code for the particular action that is to be performed.

Here is a typical function I may call to submit the iframe and start some background query:

Expand|Select|Wrap|Line Numbers
  1. function submitIfrm(s) {
  2.    if ( window.frames['prtifrm']  ) {
  3.      var f = window.frames['prtifrm'].document.ifrmform;
  4.      f.param1.value = s;
  5.      f.action.value = 'getpartslist';
  6.      f.submit();
  7.    }
  8. }
  9.  
The submitIfrm function would be called from an event, either directly or as a call from another JS function.

When the ifrm.php script is called, it does what it is asked to do (database queries mostly) and then sends any information back to the client. The ifrm.php is just a php script like the main page, but any output that is "echo"'ed is sent to the iframe on the page, and the main page is not affected by this. But as with any HTML page, the ifrm.php script can send out JS code that will be carried out on the client side in the iframe, and this code can then change fields, etc. on the main page, either directly, or by calling JS functions that are placed on the main page.

For example, here an exerpt from my ifrm.php (simplified):

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. // .... not shown: initial code in ifrm.php
  3.  
  4.     switch ($action) {
  5.         case 'getpartslist':
  6.            // not shown: code to connect to database, perform the query, and gather
  7.            // the query results in an array named $parts
  8.  
  9.            // Send this JS to the client's iframe:
  10. ?>
  11.             <script>
  12.                 parent.document.form1.partslist.length = 0;
  13. <?php
  14.                 $knt = 0;
  15.                 foreach ($parts as $key => $value)
  16.                 {
  17.                     echo "parent.document.form1.partslist.options[$knt] = new Option('$value','$key');\n";
  18.                     $knt++;
  19.                 }
  20. ?>
  21.             </script>
  22. <?php
  23.         break;
  24.         default:
  25.     }  // end of switch block
  26.  
  27. //  ... rest of php code in the ifrm.php script
  28.  
The above is only part of what is sent back, I also send back the same form as above. This example will empty out a select list on the main page called "partslist" and fill it up again with the database query results.

Again, all the above is encapsulated nicely in Ajax. I just do it in the above manner. It is not so complicated, actually.
Jun 13 '08 #8

100+
P: 348
fjm
Hey Coolsti, thanks again for the help and direction. I actually think I may be able to use the idea with the iframe tag. There is a problem though.. I need to have some of these rows blink or flash after a certain amount of time. In addition to that, I need to have a sound played in case the user is not looking at their screen.

The js would need to interact with the backend database somehow. The only way I think I would be able to acomplish this is by using AJAX. Am I correct in that assumption? I should have mentioned that earlier but I was so focused on trying to find a solution for something else.

Here is the .htc script that does not work in FF.

Expand|Select|Wrap|Line Numbers
  1. [size=2]
  2. <PUBLIC:COMPONENT>
  3.  
  4. <PUBLIC:ATTACH EVENT="onmouseover" ONEVENT="Hilite()" />
  5.  
  6. <PUBLIC:ATTACH EVENT="onmouseout" ONEVENT="unHilite()" />
  7.  
  8. <PUBLIC:ATTACH EVENT="onclick" ONEVENT="selectRow()" />
  9.  
  10. <PUBLIC:ATTACH EVENT="onselectstart" ONEVENT="cancelSelect()" />
  11.  
  12. <PUBLIC:PROPERTY NAME = MultiSelect VALUE = 0 />
  13.  
  14. <PUBLIC:PROPERTY NAME = OnColor VALUE = "#FFFFFF" />
  15.  
  16. <PUBLIC:PROPERTY NAME = OffColor VALUE = "#d5f1ff" />
  17.  
  18. <PUBLIC:PROPERTY NAME = selectedRow />
  19.  
  20. <PUBLIC:METHOD NAME="InitializeArray" />
  21.  
  22. <SCRIPT LANGUAGE="JScript">
  23.  
  24. var arrSelectedRows = new Array();
  25.  
  26. function cancelSelect()
  27.  
  28. {
  29.  
  30. event.returnValue=false;
  31.  
  32. }
  33.  
  34. function Hilite()
  35.  
  36. {
  37.  
  38. if (event.srcElement.tagName == "DIV")
  39.  
  40. {
  41.  
  42. var objDiv = event.srcElement;
  43.  
  44. var objTD = objDiv.parentNode;
  45.  
  46. } else {
  47.  
  48. var objTD = event.srcElement;
  49.  
  50. }
  51.  
  52. var objTR = objTD.parentNode;
  53.  
  54. if (objTR.tagName == "TR")
  55.  
  56. {
  57.  
  58. selectedRow = objTR.rowIndex;
  59.  
  60. objTR.style.backgroundColor=OnColor;
  61.  
  62. }
  63.  
  64. return true;
  65.  
  66. }
  67.  
  68.  
  69.  
  70. function unHilite()
  71.  
  72. {
  73.  
  74. if (event.srcElement.tagName == "SPAN")
  75.  
  76. {
  77.  
  78. var objSpan = event.srcElement;
  79.  
  80. var objTD = objSpan.parentNode;
  81.  
  82. } else {
  83.  
  84. var objTD = event.srcElement;
  85.  
  86. }
  87.  
  88. var objTR = objTD.parentNode;
  89.  
  90. if (objTR.tagName == "TR")
  91.  
  92. objTR.style.backgroundColor=OffColor;
  93.  
  94. //Re-select selected (i.e. clicked-on) rows
  95.  
  96. for (var i=0; i<arrSelectedRows.length; i++)
  97.  
  98. {
  99.  
  100. arrSelectedRows[i].style.backgroundColor = OnColor;
  101.  
  102. }
  103.  
  104. return true;
  105.  
  106. }
  107.  
  108. function selectRow()
  109.  
  110. {
  111.  
  112. if (event.srcElement.tagName == "SPAN")
  113.  
  114. {
  115.  
  116. var objSpan = event.srcElement;
  117.  
  118. var objTD = objSpan.parentNode;
  119.  
  120. } else {
  121.  
  122. var objTD = event.srcElement;
  123.  
  124. }
  125.  
  126. var objTR = objTD.parentNode;
  127.  
  128. if (objTR.tagName == "TR")
  129.  
  130. {
  131.  
  132. if (MultiSelect == -1)
  133.  
  134. {
  135.  
  136. if (!window.event.ctrlKey)
  137.  
  138. {
  139.  
  140. //If user is not pressing Ctrl key, de-select rows.
  141.  
  142. var theParent = objTR.parentElement;
  143.  
  144. for (var i=0; i<theParent.rows.length; i++)
  145.  
  146. {
  147.  
  148. theParent.rows[i].style.backgroundColor = OffColor;
  149.  
  150. }
  151.  
  152. //Reset object styles.
  153.  
  154. for (var i=0; i<arrSelectedRows.length; i++)
  155.  
  156. {
  157.  
  158. arrSelectedRows[i].style.backgroundColor = OffColor;
  159.  
  160. }
  161.  
  162. InitializeArray();
  163.  
  164. }
  165.  
  166. } else {
  167.  
  168. //De-select any selected rows
  169.  
  170. var theParent = objTR.parentElement;
  171.  
  172. for (var i=0; i<theParent.rows.length; i++)
  173.  
  174. {
  175.  
  176. theParent.rows[i].style.backgroundColor = OffColor;
  177.  
  178. }
  179.  
  180. //Reset object styles.
  181.  
  182. for (var i=0; i<arrSelectedRows.length; i++)
  183.  
  184. {
  185.  
  186. arrSelectedRows[i].style.backgroundColor = OffColor;
  187.  
  188. }
  189.  
  190. InitializeArray();
  191.  
  192. }
  193.  
  194. selectedRow = objTR.rowIndex
  195.  
  196. arrSelectedRows[arrSelectedRows.length] = objTR;
  197.  
  198.  
  199.  
  200. //SET selected row''s color.
  201.  
  202. objTR.style.backgroundColor = OnColor;
  203.  
  204. for (var i=0; i<arrSelectedRows.length; i++)
  205.  
  206. {
  207.  
  208. arrSelectedRows[i].style.backgroundColor = OnColor;
  209.  
  210. }
  211.  
  212. return true;
  213.  
  214. }
  215.  
  216. }
  217.  
  218. function InitializeArray()
  219.  
  220. {
  221.  
  222. arrSelectedRows = null;
  223.  
  224. arrSelectedRows = new Array();
  225.  
  226. }
  227.  
  228. </SCRIPT>
  229.  
  230. </PUBLIC:COMPONENT>
  231.  
  232. [/size]
Here is the html
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2.         "http://www.w3.org/TR/html4/loose.dtd">
  3. <html lang="en">
  4. <head>
  5. <style type="text/css">
  6.      .hiliter {behavior:url(scroller.htc)}
  7. </style>
  8. <title>Scroller</title>
  9. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  10. <style type="text/css">
  11.      .hiliter {behavior:url(scroller.htc)}
  12. div.scroller_picklist{
  13.      background-color:#d5f1ff;
  14.      overflow-y:scroll;
  15.      border-style:inset;
  16.      border-width:thin;
  17.      width:650px;
  18.      height:100px;
  19.      margin-right:0.5in;
  20.      margin-left:0.5in;
  21. }
  22. div.scroller_header{
  23.      height:20px;
  24.      overflow-y:visible;
  25.      border-bottom-style:none;
  26.      width:653px;
  27.      margin-right:0.5in;
  28.      margin-left:0.5in;
  29. }
  30. th.reports_header {
  31.      font-family:"verdana","arial","helvetica","sans-serif";
  32.      font-size:'75%';
  33.      font-weight:bold;
  34.      color:#FFFFFF;
  35.      background-color:#0080C0;
  36.      text-align:center;
  37. }
  38. td.picklist{
  39.      font-family:"verdana","arial","helvetica","sans-serif";
  40.      font-size:8pt;
  41.      color:#000000;
  42.      text-align:left;
  43.      cursor:hand;
  44. }
  45. </style>
  46. <script language="JavaScript" type="text/javascript">
  47. // setReturnValue
  48. // Retrieves the text from the selected row in the scroller.
  49. function setReturnValue()
  50. {
  51.      sReturnText = "";
  52.      var objTD = event.srcElement;
  53.      var objTR = objTD.parentNode;
  54.      for (var i=0;i<objTR.cells.length;i++)
  55.          sReturnText += objTR.cells(i).innerText + ";";
  56.      alert(sReturnText);
  57.      // If this code is in a popup window you would set the
  58.      // return value and close the window here. The calling
  59.      // page would parse the return value on the delimiter; we
  60.      // have used semicolons for delimiters in this example.
  61.      //if (sReturnText != null)
  62.      //{
  63.      //    window.returnValue = sReturnText;
  64.      //    window.close();
  65.      //}
  66.      return true;
  67. }
  68. </script>
  69. </head>
  70. <body bgcolor="#FFFFFF">
  71.  
  72. <div class="scroller_header">
  73. <table border="0" cellpadding="0" cellspacing="0" style="border-bottom-style:none">
  74.      <thead>
  75.          <th width='5%' class='reports_header' style='text-align:right;' height='25'>Code </th>
  76.          <th width='20%' class='reports_header' style='text-align:left;'> Description 1</th>
  77.          <th width='20%' class='reports_header' style='text-align:left;'> Description 2</th>
  78.          <th width='10%' class='reports_header' style='text-align:right;'>Value </th>
  79.          <th width='1%' class='reports_header' style='text-align:right;'> </th><!--spacer for scroll bar-->
  80.      </thead>
  81. </table>
  82. </div>
  83. <div class="scroller_picklist">
  84. <table class="hiliter" OffColor="D5F1FF" OnColor="#FFFFFF" border="0"
  85.     cellspacing="0" cellpadding="1" style="table-layout:fixed;">
  86. <tr onclick='setReturnValue();' ondblclick='setReturnValue();doOK();'>
  87.      <td class="picklist" width="5%" style="text-align:right;">1112 </td>
  88.      <td class="picklist" width="20%">Column1 Desc 1</td>
  89.      <td class="picklist" width="20%">Column2 Desc 1</td>
  90.      <td class="picklist" width="10%" style="text-align:right;">0.33 </td>
  91. </tr>
  92. <tr onclick='setReturnValue();' ondblclick='setReturnValue();doOK();'>
  93.      <td class="picklist" width="5%" style="text-align:right;">1113 </td>
  94.      <td class="picklist" width="20%">Column1 Desc 2</td>
  95.      <td class="picklist" width="20%">Column2 Desc 2</td>
  96.      <td class="picklist" width="10%" style="text-align:right;">1.63 </td>
  97. </tr>
  98. <tr onclick='setReturnValue();' ondblclick='setReturnValue();doOK();'>
  99.      <td class="picklist" width="5%" style="text-align:right;">1114 </td>
  100.      <td class="picklist" width="20%">Column1 Desc 3</td>
  101.      <td class="picklist" width="20%">Column2 Desc 3</td>
  102.      <td class="picklist" width="10%" style="text-align:right;">1.56 </td>
  103. </tr>
  104. <tr onclick='setReturnValue();' ondblclick='setReturnValue();doOK();'>
  105.      <td class="picklist" width="5%" style="text-align:right;">1115 </td>
  106.      <td class="picklist" width="20%">Column1 Desc 4</td>
  107.      <td class="picklist" width="20%">Column2 Desc 4</td>
  108.      <td class="picklist" width="10%" style="text-align:right;">1.91 </td>
  109. </tr>
  110. <tr onclick='setReturnValue();' ondblclick='setReturnValue();doOK();'>
  111.      <td class="picklist" width="5%" style="text-align:right;">1116 </td>
  112.      <td class="picklist" width="20%">Column1 Desc 5</td>
  113.      <td class="picklist" width="20%">Column2 Desc 5</td>
  114.      <td class="picklist" width="10%" style="text-align:right;">0.27 </td>
  115. </tr>
  116. <tr onclick='setReturnValue();' ondblclick='setReturnValue();doOK();'>
  117.      <td class="picklist" width="5%" style="text-align:right;">1117 </td>
  118.      <td class="picklist" width="20%">Column1 Desc 6</td>
  119.      <td class="picklist" width="20%">Column2 Desc 6</td>
  120.      <td class="picklist" width="10%" style="text-align:right;">0.33 </td>
  121. </tr>
  122. <tr onclick='setReturnValue();' ondblclick='setReturnValue();doOK();'>
  123.      <td class="picklist" width="5%" style="text-align:right;">1118 </td>
  124.      <td class="picklist" width="20%">Column1 Desc 7</td>
  125.      <td class="picklist" width="20%">Column2 Desc 7</td>
  126.      <td class="picklist" width="10%" style="text-align:right;">1.63 </td>
  127. </tr>
  128. <tr onclick='setReturnValue();' ondblclick='setReturnValue();doOK();'>
  129.      <td class="picklist" width="5%" style="text-align:right;">1119 </td>
  130.      <td class="picklist" width="20%">Column1 Desc 8</td>
  131.      <td class="picklist" width="20%">Column2 Desc 8</td>
  132.      <td class="picklist" width="10%" style="text-align:right;">1.56 </td>
  133. </tr>
  134. <tr onclick='setReturnValue();' ondblclick='setReturnValue();doOK();'>
  135.      <td class="picklist" width="5%" style="text-align:right;">1120 </td>
  136.      <td class="picklist" width="20%">Column1 Desc 9</td>
  137.      <td class="picklist" width="20%">Column2 Desc 9</td>
  138.      <td class="picklist" width="10%" style="text-align:right;">1.91 </td>
  139. </tr>
  140. <tr onclick='setReturnValue();' ondblclick='setReturnValue();doOK();'>
  141.      <td class="picklist" width="5%" style="text-align:right;">1121 </td>
  142.      <td class="picklist" width="20%">Column1 Desc 10</td>
  143.      <td class="picklist" width="20%">Column2 Desc 10</td>
  144.      <td class="picklist" width="10%" style="text-align:right;">0.27 </td>
  145. </tr>
  146. <tr onclick='setReturnValue();' ondblclick='setReturnValue();doOK();'>
  147.      <td class="picklist" width="5%" style="text-align:right;">1122 </td>
  148.      <td class="picklist" width="20%">Column1 Desc 11</td>
  149.      <td class="picklist" width="20%">Column2 Desc 11</td>
  150.      <td class="picklist" width="10%" style="text-align:right;">0.33 </td>
  151. </tr>
  152. </table>
  153. </div>
  154. </body>
  155. </html>
  156.  
Because I am wondering how to implement this blinking and playing a sound byte, I really don't even know where to start. :)
Jun 13 '08 #9

100+
P: 310
Hi and sorry I have been away for some days.

I do not have time to try to go through your code, but I can say two quick things:

Firstly, if you need things to blink and be timed on your page, you could best do that with Javascript on the page. There you should look for some examples on the internet about how to timers work in JS. It can be a bit confusing at first. But you can make make things happen after certain amounts of time this way. If for example you want a certain button to start blinking 15 seconds after the user has loaded the page, and to be yellow for 3 seconds and then green for three seconds, you can do the following (in words): Have a countdown timer start when the page is loaded (JS function called from the onload event), and when this counter has finished, it calls another function. This other function then repeatedly sets a 3 second countdown timer, and at the end of the count (or beginning, to make the first color change at 15 seconds) you have the JS function toggle the class of the button in question between one that has a yellow background and one that has a green background. If you want, for example, such a blinking to start when the user has not touched the page for 15 seconds, then you have the 15 second timer reset itself, and have this reset operation tied to the keypress and onmousemove events, for example.

Secondly, let me break this apparently popular myth that is going around: you do not need to use AJAX to communicate with the server in the background. My previous post with the iframe is how you do it "the old fashioned, pre-Ajax" way. If you take the time to learn what Ajax is all about, I am sure it will help you greatly, but should not think that if you do not know how to use Ajax that you cannot run scripts, perform queries, etc. in the background.
Jun 18 '08 #10

Post your reply

Sign in to post your reply or Sign up for a free account.