View Full Version : Scriptaculous scroll effect in a form?

02-06-2007, 10:06 PM
Hi there,

I have the following form at my website...

<script type="text/javascript" language="javascript" charset="utf-8">
// <![CDATA[
var effect_1 = null;
// ]]>

<a href="#" onclick="effect_1 = Effect.SlideDown('d1',{duration:1.0}); return false;">Start slide down</a> |
<a href="#" onclick="effect_1 = Effect.SlideUp('d1',{duration:1.0}); return false;">Start slide up</a> |
<a href="#" onclick="effect_1.cancel(); return false;">cancel()</a> |
<a href="#" onclick="alert(Object.inspect($('d1').firstChild.style)); return false;">inspect()</a> |
<a href="#" onclick="$('d1').firstChild.innerHTML += $('d1').firstChild.innerHTML; return false;">add content</a>

<div id="d1" style="display:none;"><div class="account_bar">
<div class="account_bar_img"><img src="http://digg.com/userimages/a/l/l/allsortgroup/small2202.jpg" alt="Demo Account" /></div><div class="account_bar_left">Hello, Guest! | <a href="/">Register</a> or Login</div><div class="account_bar_right">
<form action="http://www.allsorthost.com/client/index.php" method="POST" name="form1" id="form1">
Username: <input type="text" name="USERNAME" size="12" value="<?php echo $_GET[quick_username]; ?>" class="account_form_text" />
&nbsp;Password: <input type="password" name="PASSWORD" size="12" value="<?php echo $_GET[quick_password]; ?>" class="account_form_text" />
&nbsp;<INPUT TYPE="hidden" NAME="LOGIN" VALUE="1"><input type="submit" name="Submit" value="Login" class="form_submitt">


Basically, i go to my website, then i click scroll down, and it has the login box. Then i type in my login details and it logges me in.

But is there a line of code that i can add to make the form scroll up, and then log the user in? I have tried putting the following in the <form> line before the form action, but all it does is scrolls up and doesnt log me in???...

onsubmit="effect_1 = Effect.SlideUp('d1',{duration:1.0}); return false;"

How can i get it so that when users login, the form delays for 1 or 2 seconds while the login boxes fade up, and then it goes to the client panel?