Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Aug 2006
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Ajax.Updater (prototype.js) checkbox updating

    Hi,
    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.p...k=view&id=2123)

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

    Joe

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    What are you doing that is not checking the checkbox when you click on it?

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #3
    New Coder
    Join Date
    Aug 2006
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    PHP Code:
    <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.

  • #4
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    remove the return false

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #5
    New Coder
    Join Date
    Aug 2006
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks mate!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •