View Full Version : Ajax.Updater (prototype.js) checkbox updating

11-30-2006, 04:34 PM
I am using the script.aculo.us library but at the minute am using a function included with prototype.js which is Ajax.Updater. I have it sort of working but with just one problem.

[ ] <-- The checkbox isn't checked. When I click on it, the database updates (ajax) but the checkbox stays unchecked until I refresh (I have a PHP code that grabs values from the database).

I need the checkbox to check itself after the database is updated, as well as when the page is loaded new. Definately possible because it is done on the Vanilla forum preferences page (Account => Forum Preferences). Look at that on OSCMS (http://www.opensourcecms.com/index.php?option=com_content&task=view&id=2123)

Sorry, this is quite confusing... Hope you can help me though.


11-30-2006, 05:23 PM
What are you doing that is not checking the checkbox when you click on it?


11-30-2006, 05:41 PM
<input type="checkbox" name="ads_somethin" id="ads_somethin" onclick="new Ajax.Updater('ads_somethin', 'ajax/updateads.php?u=somethin', {asynchronous:true, evalScripts:true}); return false;"<?php if($r_account->has_ads == 1){echo ' checked="checked"';} ?> /> ? Sorry if I misunderstood your comment.

11-30-2006, 06:01 PM
remove the return false


11-30-2006, 06:34 PM
:) Thanks mate!

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum