Link to home
Start Free TrialLog in
Avatar of dkim18
dkim18

asked on

Changing bean message without reloading page

hi!

I am trying to change bean message without reloading page upon button click event. Is there any way of doing it?
++++++++++
<table align="center" width="25%" cellspacing="0" cellpadding="0">
      <tr>
       <th span class="entrycolor"><bean:message  key="firstentry" /></span></th>
      </tr>
</table>
++++++++++++
Or, is there any way of changing font and color of  html:text value just like bean message?
thanks,
ASKER CERTIFIED SOLUTION
Avatar of bloodredsun
bloodredsun
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
here's a fully functional example, cut-n-paste locally and play with it :

----------------------------



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>

   <title>test</title>

   <style type="text/css">
   *.entrycolor {
      background-color: white;
      color: black;
   }

   *.highlightedcolor {
      background-color: yellow ;
      color: black;
   }

   </style>

   <script type="text/javascript">
   function handleSpanClick(anElement)
   {
      if (anElement.className == "entrycolor")
      {
         anElement.className = "highlightedcolor";
      }
      else
      {
         anElement.className = "entrycolor";
      }
   }
   </script>


</head>

<body>

<div class="outer">
   <div class="floatRight">
      <table>
         <tr>
            <td><span class="entrycolor" onclick="javascript:handleSpanClick(this);">entry 1</span></td>
         </tr>
         <tr>
            <td><span class="entrycolor" onclick="javascript:handleSpanClick(this);">entry 2</span></td>
         </tr>
         <tr>
            <td><span class="entrycolor" onclick="javascript:handleSpanClick(this);">entry 3</span></td>
         </tr>
      </table>
   </div>
</div>
</body>

</html>
(ignore the div stuff there, that's left over from a previous testbed...)
split between lhankins  and bloodredsun