View Full Version : JavaScript Onload Function

08-24-2010, 08:55 PM

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:


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


08-25-2010, 12:07 AM
Despite the similar sounding names, Java is not the same as Javascript.
Moving from Java forum to Javascript forum.

Old Pedant
08-25-2010, 01:08 AM
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

function set_drop_option(radio_button) {
REDIPS.drag.drop_option = radio_button.value;


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

REDIPS.drag.trash_ask = true;
inside that same onload function.