Results 1 to 3 of 3
  1. #1
    pjeremypj is offline Member
    Join Date
    Dec 2009
    Posts
    1
    Rep Power
    0

    Default Dynamic element in a statement

    Hello,

    I am developing a website with a questionnaire. Some questions will make other questions disabled, depending on a variable. In the radiobutton of the question I made an "onclick"-reference to the disableField function with an variable in it being the number of the question. I want this variable being part of the statement (also ???). Is it possible to create a sort of dynamic element in this statement, depending on a variable? Thanks in advance for helping me.

    function disableField(???) {
    myform.???[0].disabled=true;
    myform.???[1].disabled=true;
    myform.???[2].disabled=true;
    myform.???[3].disabled=true;
    }

  2. #2
    Addez is offline Senior Member
    Join Date
    Aug 2009
    Posts
    294
    Rep Power
    0

    Default

    maybe, idk if this might help in anyway, but u could maybe do like this:
    blah blah function(){
    button1 = true;
    button2 = button1 ? true : false;

    I think that's the way to do it..

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,049
    Rep Power
    20

    Default

    Or, possibly, post this on a Javascript forum, and not a Java one?

Similar Threads

  1. How to access element in a CSV?
    By venkatteshb in forum New To Java
    Replies: 11
    Last Post: 08-17-2008, 11:37 AM
  2. how can we get the element of by using the hashtable
    By raj reddy in forum Web Frameworks
    Replies: 1
    Last Post: 05-06-2008, 01:45 PM
  3. Max element in an Array
    By mew in forum New To Java
    Replies: 5
    Last Post: 12-03-2007, 05:26 PM
  4. a no such element exception
    By headlice1 in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 05:36 PM
  5. Statement or Prepared Statement ?
    By paty in forum JDBC
    Replies: 3
    Last Post: 08-01-2007, 04:45 PM

Posting Permissions

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