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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    I've looked everywhere...

    Very new to JavaScript but need to get this done for work... No matter what I do, this if/else statement always runs completely through! It even bypasses the break. I'm not sure what I'm doing wrong, and I've compared it to many other people's samples of if/else's... Any help would be great!

    if (form.ldap.checked)
    {<cfset LDAPstatus = false>
    <cfset QRY_updateSysObjectValueLDAP = objAdmin.updateSysObjectValue("0", 'LDAP/AD') />
    break;
    }
    else
    {
    <cfset LDAPstatus = true>
    <cfset QRY_updateSysObjectValueLDAP = objAdmin.updateSysObjectValue("1", 'LDAP/AD') />
    <!--- Checks to see if LDAP/AD authentication is enabled; if so, retreives LDAP/AD settings --->
    <cfset QRY_updateSysObjectValueDomain = objAdmin.updateSysObjectValue('#form.Domain#', 'Domain') />
    <cfset QRY_updateSysObjectValueServer = objAdmin.updateSysObjectValue('#form.Server#', 'LDAPServer') />
    <cfset QRY_updateSysObjectValueAccountOU = objAdmin.updateSysObjectValue('#form.AccountOU#', 'AccountOU') />
    break;
    }

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Because server-side codes are run on the server to generate HTML/CSS/Javascript codes, while Javascript runs on the client-side. By the time the browser renders the page, all the server-side codes have been completely executed. What you need to do is either:

    1. Submit the page to send the request to the server. This requires page refresh.
    2. Use AJAX to send request to the server without page refresh.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________


  •  

    Posting Permissions

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