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

    JavaScript Onload Function

    Hi



    I am new to javascript and designing websites as a whole. I have been playing around with a drag and drop java script from this site:

    http://www.redips.net/javascript/dra...table-content/

    A switch content setting is currently available to check in a checklist:

    <input name="drop_option" type="radio" class="checkbox" title="Switch content" onclick="set_drop_option(this)" value="switch"/>

    I wan it to run without any checklist or button whatsoever just from the page load. I am not sure how I would do this. Any suggestions?

    Thank you

    Jonathan

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Despite the similar sounding names, Java is not the same as Javascript.
    Moving from Java forum to Javascript forum.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • #3
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,554
    Thanks
    80
    Thanked 4,620 Times in 4,583 Posts
    The radio buttons there are *STRICTLY* for demonstration purposes. To show you what kinds of controls are *POSSIBLE* with the library he gives you.

    GET RID of the radio buttons (and check boxes!) when using this code for a dedicated purpose.

    *INSTEAD* change the code from
    Code:
    function set_drop_option(radio_button) {
        REDIPS.drag.drop_option = radio_button.value;
    }
    to
    Code:
    REDIPS.drag.drop_option = "switch";
    and put that line inside the existing window.onload function code.

    Similar is true for the checkboxes. For example, if you want to always do the confirm before trashing something, just put the line
    Code:
    REDIPS.drag.trash_ask = true;
    inside that same onload function.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Tags for this Thread

    Posting Permissions

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