...

View Full Version : JavaScript Onload Function



jonathan442
08-24-2010, 07:55 PM
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/drag-and-drop-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

Fou-Lu
08-24-2010, 11:07 PM
Despite the similar sounding names, Java is not the same as Javascript.
Moving from Java forum to Javascript forum.

Old Pedant
08-25-2010, 12: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;
}

to


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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum