Deanznet Posted March 2, 2008 Share Posted March 2, 2008 hey! i have a script that submits on click the codes here. javascript:document.forms['upload_form'].submit(); Works fine! But when i add a login box to the top it wont work unless i remove <form name="login" form action="users.php?act=login-d" method="post"> <input type="hidden" name="return" value="" /> Any idea to this? Quote Link to comment Share on other sites More sharing options...
haku Posted March 2, 2008 Share Posted March 2, 2008 Nope. Thats not enough code to be able to say anything. Quote Link to comment Share on other sites More sharing options...
Deanznet Posted March 2, 2008 Author Share Posted March 2, 2008 Here Sorry About That.. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-gb" xml:lang="en-gb"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="Content-Language" content="en-gb" /> <meta http-equiv="imagetoolbar" content="no" /> <title><# PAGE_TITLE #></title> <meta name="keywords" content="image hosting, image hosting service, multiple image hosting, unlimited bandwidth, quick image hosting" /> <meta name="description" content="<# SITE_NAME #> is an easy image hosting solution for everyone." /> <base href="<# BASE_URL #>" /> <link href="style.css" rel="stylesheet" type="text/css" media="screen" /> <link rel="shortcut icon" href="css/images/favicon.ico" /> <script type="text/javascript" src="http<# URL_SCHEME #>.google-analytics.com/urchin.js"></script> <script type="text/javascript" src="source/includes/genjscript.js"></script> </head> <body> <div id="wrapper"> <div id="wrapper2"> <div id="header"> <div id="logo"> <h1><# SITE_NAME #></h1> </div> <div id="loginbox"> <form name="login" form action="users.php?act=login-d" method="post"> <td width='45%' align='right'><span class="style1"> Username:</span></td><td><input type='text' name='username' size='25' value=''> <td width='45%' align='right'><span class="style1">Password</span>:</td><td><input type='password' name='password' size='25'><center><br /><input name="Submit" type="submit" value="Log In" /></td></div> </div> <div id="menu"> <ul> <li><a href="index.php">Homepage</a></li> <li><a href="gallery.php">Gallery</a></li> <li><a href="info.php?act=about_us">About</a></li> <li><a href="#">Resources</a></li> <li><a href="contact.php?act=contact_us">Contact</a></li> </ul> </div> </div> <!-- end #header --> <div id="page"> <div id="content"> <div class="post"> <h2 class="title"><a href="#">Welcome to <# SITE_NAME #></a></h2> Select an image file to upload - <a href="index.php?url=1">URL Upload</a><br /> Max file size is set at: <# MAX_FILESIZE #> per file. <br /><br /> <form method="post" id="upload_form" enctype="multipart/form-data" action="upload.php"> <p> <input name="userfile[]" type="file" size="50" /> <br /> <input name="userfile[]" type="file" size="50" /> <br /> <input name="userfile[]" type="file" size="50" /> <br /> <input name="userfile[]" type="file" size="50" /> <br /> <input name="userfile[]" type="file" size="50" /> <br /> <span id="more_file_inputs"></span> <br /> <if="$mmhclass->info->is_user == false"> Upload Type: <input type="radio" name="private_upload" value="0" checked="checked" /> Public <input type="radio" name="private_upload" value="1" /> Private <br /><br /> </endif> <input class="button1" type="button" onclick="javascript:new_file_input();" value="Add More Files" /> <input class="button1" type="button" value="Start Uploading" onclick="javascript:toggle_lightbox('index.php?act=upload_in_progress', 'progress_bar_lightbox'); javascript:document.forms['upload_form'].submit();" /> </p> </form> Quote Link to comment Share on other sites More sharing options...
haku Posted March 2, 2008 Share Posted March 2, 2008 Try adding this to the head of your document: function button_action(){ toggle_lightbox('index.php?act=upload_in_progress', 'progress_bar_lightbox') var target = document.getElementById("upload_form") target.submit() } And change your input tag to look like this: <input class="button1" type="submit" value="Start Uploading" onclick="button_action()" /> Quote Link to comment Share on other sites More sharing options...
Deanznet Posted March 2, 2008 Author Share Posted March 2, 2008 K that submits the login form now lol.. Quote Link to comment Share on other sites More sharing options...
Deanznet Posted March 3, 2008 Author Share Posted March 3, 2008 Anyone? ??? Quote Link to comment Share on other sites More sharing options...
wyg Posted March 3, 2008 Share Posted March 3, 2008 sorry! i don't know what did you say! Quote Link to comment Share on other sites More sharing options...
haku Posted March 4, 2008 Share Posted March 4, 2008 I don't get it. You asked a question, I answered, you said the problem was solved. So what else are you asking? Quote Link to comment Share on other sites More sharing options...
Deanznet Posted March 4, 2008 Author Share Posted March 4, 2008 Oh sorry i wrote it wrong. The Problems is not solved. Instead uploading the file it submits the login form instead of the upload. Quote Link to comment Share on other sites More sharing options...
haku Posted March 4, 2008 Share Posted March 4, 2008 Your problem is that you are trying to make two forms worth of function, but have only made one form. You need to separate the login functions from the upload functions, and put them in separate form tags. Do that first, post your code, then lets look at your javascript. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.