Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-24-2010, 07:55 PM   PM User | #1
jonathan442
New to the CF scene

 
Join Date: Aug 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
jonathan442 is an unknown quantity at this point
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
jonathan442 is offline   Reply With Quote
Old 08-24-2010, 11:07 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,741
Thanks: 4
Thanked 2,465 Times in 2,434 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
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'); 
Fou-Lu is offline   Reply With Quote
Old 08-25-2010, 12:08 AM   PM User | #3
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,556
Thanks: 62
Thanked 4,054 Times in 4,023 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
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.
Old Pedant is online now   Reply With Quote
Reply

Bookmarks

Tags
drag and drop

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:47 AM.


Advertisement
Log in to turn off these ads.