Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5997875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:19:34+00:00 2026-05-23T00:19:34+00:00

I have quite a large IF statement which needs to update another form element

  • 0

I have quite a large IF statement which needs to update another form element depending on which scenarion only Its not working, By not working I mean its not updating the form element nor executing any more code in that statement.

My code is…

window.onload = function() {
new Dragdealer('magnifier', {
    steps: 10,
    snap: true,
callback: function(value) {
    if(value == 0) {
        alert('1');
        }
    else if(value == 0.1111111111111111) {
        alert('2');
        }
    else if(value == 0.2222222222222222) {
        alert('3');
        }
    else if(value == 0.3333333333333333) {
        alert('4');
        }
    else if(value == 0.4444444444444444) {
        document.getElementById(coff_upd).value = '5';
        alert('5');
        }
    else if(value == 0.5555555555555556) {
        document.getElementById(coff_upd).value = '6';
        alert('6');
        }
    else if(value == 0.6666666666666666) {          
        document.getElementById(coff_upd).value = '7';
        alert('7');
        }
    else if(value == 0.7777777777777778) {
        document.getElementById(coff_upd).value = '8';
        alert('8');
        }
    else if(value == 0.8888888888888888) {
        document.getElementById(coff_upd).value = '9';
        alert('9');
        }
    else {
        document.getElementById(coff_upd).value = '10';
        alert ('10');
    }
    }
});
}

and the input…

    <input type="text" value="<?php echo $user_curr_coff;?>" name="coff_upd" id="coff_upd" />
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T00:19:35+00:00Added an answer on May 23, 2026 at 12:19 am

    Don’t know if you cut and pasted your code but: document.getElementById(coff_upd).value = '5'; won’t work as js is looking for a variable named coff_upd. You need to put quotes around it: document.getElementById("coff_upd").value = '5';

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a several functions which are quite large, and are only used in
We have quite Large Web Based System, which is recently converted from Website to
I have quite a large nvarchar which I wish to pass to the HashBytes
I have a quite large website, in which there is a forum powered by
I have quite a large VB6 project, with many forms, classes, modules and user
I have quite a large table with 19 000 000 records, and I have
I have quite a large XSL document for an assignment that does a number
I have two quite large tables, let's call them 'authors' and 'articles'. Every row
I have a multi-line text view that can get quite large. When the user
I have a web application project that works with a quite large database (over

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.