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
    Regular Coder thesmart1's Avatar
    Join Date
    Dec 2005
    Posts
    369
    Thanks
    7
    Thanked 3 Times in 3 Posts

    User sets variables

    Is there any way to use several text fields to allow a user to set variables to be implemented later on in the page?

    If so, is there a way to put the variables into groups using document.write() strings and alphabetize these by the first variable in them?

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    can u detail your aim? can you give us an algorithm of what you need?
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    Regular Coder thesmart1's Avatar
    Join Date
    Dec 2005
    Posts
    369
    Thanks
    7
    Thanked 3 Times in 3 Posts
    The user types words in a set of text fields. These words are assigned to javascript variables. I would display these variables on the page using document.write() strings. If possible, the document.write() strings would also be alphabetized by the first variable.

  • #4

  • #5
    Regular Coder
    Join Date
    May 2005
    Posts
    100
    Thanks
    0
    Thanked 0 Times in 0 Posts
    put them in a array, sort them, loop through the array and append the text to a div or w/e.


    Code:
    var the_array = [];
    the_array.push(your_variables);
    the_array.sort();
    for(var s=0;s<the_array.length;s++){
    document.getElementById('someid').appendChild(document.createTextNode(the_array[s]));
    }
    something like that.


  •  

    Posting Permissions

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