There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Software Development
Tag Cloud
audio blue screen boot bsod computer cpu crash dell desktop driver drivers error excel external hard drive firefox freezes freezing hard drive hardware hijackthis internet internet explorer itunes laptop malware motherboard mouse network networking ntfs outlook outlook 2007 power printer problem ram router screen slow sound trojan usb virus vista vista 32-bit windows windowsxp windows xp winxp wireless
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
Frontpage!


Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
ckaas's Avatar
Senior Member with 133 posts.
 
Join Date: Feb 2003
05-Oct-2003, 04:44 AM #1
Frontpage!
hey again everybody. I'm working on this website for my school and i have a page with a contact form on it. i also have a letter clipart outside the form area. what i have been trying to do, unsuccessfully, is to set up a DHTML effect so that when the user clicks on the "Sumbit" button, the letter flies off. Is there any way to do that? Thanks

Christian K.
wizzkid's Avatar
Senior Member with 572 posts.
 
Join Date: Jan 2003
Location: Manchester. UK
05-Oct-2003, 11:24 AM #2
eddie5659's Avatar
Computer Specs
Moderator with 18,680 posts.
 
Join Date: Mar 2001
Location: Bradford, England
06-Oct-2003, 07:42 PM #3
Moved you to Developement
khaki's Avatar
Distinguished Member with 2,433 posts.
 
Join Date: Jul 2003
06-Oct-2003, 11:08 PM #4
hi Christian....

what is the action of your submit???

normally, a form submits.... and an action occurs (like submitting to a different page).

I'm not going to say that you can't have the action also fire a different event (such as moving an object on the page)....
but if the form is submitting.... the objects on the form page won't matter much once the user submits the form.

I can provide you with some code..... but I don't think that it is applicable to be used with an onSubmit action.

Give me a sec to type it out.....
then you can apply it to whatever action you want to attach it to (although.... like I said.... a form submission does not seem to be the proper event for it)

give me a sec...........................
khaki's Avatar
Distinguished Member with 2,433 posts.
 
Join Date: Jul 2003
06-Oct-2003, 11:57 PM #5
okay Christian.....

here is some code that moves an object.

it's attached to an event that is fired by clicking a link....
you can modify it as needed.

like I said....
a form is not really suited to this action....
but feel free to get imaginative (that's what DHTML is all about )

have fun

<html>
<head>
<title>move object</title>
<script>
var isDHTML = 0;
var isLayers = 0;
var isAll = 0;
var isID = 0;

if (document.getElementById) {isID = 1; isDHTML = 1;}
else {
if (document.all) {isAll = 1; isDHTML = 1;}
else {
browserVersion = parseInt(navigator.appVersion);
if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) {isLayers = 1;

isDHTML = 1;}
}}

function findDOM(objectID,withStyle) {
if (withStyle == 1) {
if (isID) { return (document.getElementById(objectID).style) ; }
else {
if (isAll) { return (document.all[objectID].style); }
else {
if (isLayers) { return (document.layers[objectID]); }
};}
}
else {
if (isID) { return (document.getElementById(objectID)) ; }
else {
if (isAll) { return (document.all[objectID]); }
else {
if (isLayers) { return (document.layers[objectID]); }
};}
}
}
</script>
<script language="javascript">
function moveObjectTo(objectID,x,y) {
var domStyle = findDOM(objectID,1); domStyle.left = x; domStyle.top = y;
}
</script>
<style type="text/css">
#ob {
position: absolute;
top: 100px;
left: 30px;
font-size: 50px;
font-weight: bold;
color: #c00;
}
</style>
</head>

<body>
<a href="javascript:void('')" onClick="moveObjectTo('ob',500,350);">Click Me</a>
<div id="ob" >
Your Letter
</div>
</body>
</html>


NOTE: No space between "java" and "script" in this line:
<a href="javascript:void('')"
(the forum sticks that in there)

Last edited by khaki : 07-Oct-2003 12:03 AM.
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 02:31 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.