Question: I have the following div tag: (jobform)

```
<!--jobform-->
<div class="jobform" onclick="SetChecks();">
<div class="jobform_l" ><?php _e('Category');?> : <span class="required">*</span>      </div>

<div class="jobform_r" > 

<?php require_once (TEMPLATEPATH . '/jobs_category.php');?>
</div>
<div class="aglabel">Job Poster :</div>
</div><!--jobform-->

```

I am generating an array of checkboxes (Categories), since I don't have the checkbox tags I will need to capture the event of `onclick` on this div and check/uncheck certain checkboxes. Like when one is checked I want the other one to be unchecked. So I have implemented the following Javascript to do that:

```
<script type="text/javascript"> 
function SetChecks() { 
Alert("test");
if(document.getElementById('41').Checked)
{
document.getElementById('39').Checked = false;
}
else if(document.getElementById('39').Checked)
{
document.getElementById('41').Checked = false;
}
</script>

```

But for some reason it is not being triggered, I event tried putting an `Alert()` just to make sure it is being clicked or no.

Answer: 
[JAX-RS](http://wikis.sun.com/display/Jersey/Overview+of+JAX-RS+1.0+Features) is a really nice lightweight way of doing rest on the JVM. There are plugins that convert JAXB annotated objects into JSON, or you could just roll that yourself in a multitude of ways.

[EclipseLink](http://www.eclipse.org/eclipselink/) is a good implementation of the JPA spec. Its a pretty easy way to map your objects to the database through annotations. JAX-RS works with this by default, e.g. you can look up an object with JPA. You can then annotate it with JAXB and then return it straight up from your web service method (if you want XML) and it will just work. There's also a plugin for Jersey (the JAX-RS reference implementation) that allows you to serialize things as JSON this way too.

These JAX-RS, JPA and JAXB are three really nice API's. They don't do everything, but they're lightweight and help you to get real work done without a lot of fuss.
I'd recommend Rails or Sinatra (which you could run on top of Java with JRuby). Both can take advantage of ActiveRecord and other Ruby ORM and DB connection libraries; you should be able to make these libraries talk to your legacy databases without too much trouble.