SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    ********* Janitor levik's Avatar
    Join Date
    Jan 2003
    Location
    New York
    Posts
    885
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Hierarchical SELECT-like script

    I am in the process of implementing a SELECT replacement script that uses JS and DOM to allow for the ability to open hierarchical submenus. For this should be very useful for allowing selections from large tree-type hierarchies. For example:
    Code:
          + Books
          |   + Fiction
          |   |   + Treasure Island
          |   |   + To Kill a Mockingbird
          |   + Non Fiction
          |       +  Office For Dummies
          + Music
               + Mozart
               + Bach
    Well, you get the point.

    I have it more or less working on both Mozilla and IE, not sure about the Mac platforms yet.

    I was wondering if I am reinventing a wheel here, is there already something fairly standard that will offer this kind of functionality? I would need to have it tie in to an existing HTML form (my version will be updating a hidden field) and optionally support an equivalent of the onChange handler.

    If such a thing doesn't yet exist, how many here would find it useful? Would you pay a one-time fee for this script? If so, would it be in the ballpark of $5, $50 or $500? (I'm guessing NOT $500 )

  2. #2
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    if you mean a cascading select script, yes you are re-inventing the wheel -- there are two here:
    http://members.aol.com/grassblad
    and another here:
    http://members.aol.com/grassblad/cascade3.html
    and a number at http://www.dynamicdrive.com
    and probably umpteen million more if you search google.
    Would I be willing to pay X dollars for a generic script -- not on your bloody life (I've had an annoying day with posters on a number of boards today
    Would anyone here be willing to pay? Not if they got any brains -- why pay when you can get if for free by idiots like me?

    Vinny
    Where the World Once Stood
    the blades of grass
    cut me still

  3. #3
    ********* Janitor levik's Avatar
    Join Date
    Jan 2003
    Location
    New York
    Posts
    885
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You misunderstood the scipt I was talking about. The sites you pointed me to use a series of SELECT boxes to mimic the functionality. You pick option 1 from select box 1, which populates select box 2.

    This is not only awkward, but will only work as deep down as you have SELECT boxes in advance.

    The script I am working on will work like a windows menu with nested submenus - they all open as submenus of the initial control.

    Why pay? Would you not pay $5 for a script somebody spent two weeks working on, the use of which could benefit you and save you quite a bit of time?

  4. #4
    The doctor is in... silver trophy MarcusJT's Avatar
    Join Date
    Jan 2002
    Location
    London
    Posts
    3,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    *I* understand you, levik! lol

    There may or may not be a script like that already in existence (I wouldn't know, I write everything I need myself), and it does sound novel to me, but I wouldn't have thought it would be hard to adapt an existing hierarchical menu system for this purpose.

    You're extremely unlikely too get anyone to actually pay for such code, since JavaScript (by its very nature) is very easy to copy and use without someone's permission. If your script is any good then it will probably spread like wildfire, and you will get only a couple of honest souls paying for it.

    A better plan of action if you are determined to try and make money from it might be to release the script for free, but then develop a desktop application (or Dreamweaver extension) which will make generating the code easier for users. The standard software piracy problems will still apply of course, but you will have something more likely to saleable.
    MarcusJT
    - former ASP web developer / former SPF "ASP Guru"
    - *very* old blog with some useful ASP code

    - Please think, Google, and search these forums before posting!

  5. #5
    ********* Janitor levik's Avatar
    Join Date
    Jan 2003
    Location
    New York
    Posts
    885
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK, it took a while longer than I had expected, but I managed to finish it!

    Check it out at http://www.flooble.com/scripts/hier.php and let me know what you think.

  6. #6
    The doctor is in... silver trophy MarcusJT's Avatar
    Join Date
    Jan 2002
    Location
    London
    Posts
    3,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Excellent! I'm sure that will come in very handy for lots of things... I'm thinking country and county/state selectors in particular.

    MarcusJT
    - former ASP web developer / former SPF "ASP Guru"
    - *very* old blog with some useful ASP code

    - Please think, Google, and search these forums before posting!

  7. #7
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Very nice!

    From my own experience with making purposely reusable javascript, selling is very difficult. If you have truly made something novel and something people want, then they'll pay you for it. I take donations for my fValidate script, but I don't charge for it. I've considered it, but haven't done so yet.

    One option is to require that people give you mention, or link to your site (can help with your Google PageRank), or pay to use the script without having to mention/credit it (fValidate will soon use a system like this). However, with the large variety of menu scripts out there, as mentioned before, you've got a lot of competition - many of which are free.

    IMHO, the script you have is good but, since you're intentionally making it for distribution, you should make it an object (or object-oriented, if you prefer). From my count, in your script, I see 28 global objects!! If you aren't familiar with this type of javascript coding, I encourage you to learn. That way, you can make a script for sharing that won't cause anybody any headaches when they try using your script with 1 or more other scripts.

    And for the 2 week thing - that's not a long time, really. Sure, it makes business sense to purchase something rather than pay an individual two-weeks pay to re-create it, but some projects take far longer.

    Best of luck!
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  8. #8
    The doctor is in... silver trophy MarcusJT's Avatar
    Join Date
    Jan 2002
    Location
    London
    Posts
    3,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    Quote Originally Posted by beetle
    IMHO, the script you have is good but, since you're intentionally making it for distribution, you should make it an object (or object-oriented, if you prefer). From my count, in your script, I see 28 global objects!! If you aren't familiar with this type of javascript coding, I encourage you to learn. That way, you can make a script for sharing that won't cause anybody any headaches when they try using your script with 1 or more other scripts.

    And for the 2 week thing - that's not a long time, really. Sure, it makes business sense to purchase something rather than pay an individual two-weeks pay to re-create it, but some projects take far longer.
    I'll second that. In my haste to whizz through my inbox I didn't take the time to check out the source code, and it does indeed leave room for improvement.

    As Beetle suggests, recoding to use a more OOP-based approach would be advantageous, and I suggest that while you're at it you expose as many variables as possible to user modification (e.g. timeouts, widths, heights, etc) - customisation seems to be very important to most cut'n'pasters, so that's something you should definitely bear in mind (info on how the CSS is applied/used would be handy, for example).
    MarcusJT
    - former ASP web developer / former SPF "ASP Guru"
    - *very* old blog with some useful ASP code

    - Please think, Google, and search these forums before posting!


Bookmarks

Posting Permissions

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