paulman888888 Posted June 24, 2009 Share Posted June 24, 2009 hi; i have been trying to learn javascript and think i understand i tiny bit. I know my code below will not work but i have been trying, but i am losing my will to live. <script type="text/javascript"> var uploaded=0; var uploads=10; function check_uploads(){ if(uploaded=uploads){ upload_completed(); }} function upload_completed(){ copy_variables(); submit.form.MYFORMID; } function copy_variable(){ form.copy_to_me.fieldid.value=form.formid.fieldid.value; } </script> Can someone make this in to a script that will work please syntax-wize anyway. I think i would be able to make my whole script work if i had an example piece of code. Also if i have an iframe and want to add to a variable thats in not in the iframe, do i need to do anything more then if it wasn't. I very sorry for my bad word but i am trying to learn. Please don't to nasty. Thankyou all Paul Link to comment https://forums.phpfreaks.com/topic/163493-new-to-javascript-simple-variaboles/ Share on other sites More sharing options...
corbin Posted June 24, 2009 Share Posted June 24, 2009 if(uploaded=uploads){ Perhaps that should be if(uploaded==uploads){ Errrr submit.form.MYFORMID; <-- Where's that coming from? form.copy_to_me.fieldid.value=form.formid.fieldid.value; <-- Where's that coming from? Link to comment https://forums.phpfreaks.com/topic/163493-new-to-javascript-simple-variaboles/#findComment-862720 Share on other sites More sharing options...
paulman888888 Posted June 24, 2009 Author Share Posted June 24, 2009 Sorry about my last post. It was very bad. in the head i have <script type="text/javascript"> var uploaded=0; var uploads=1; function start_uploads(){document.forms["form_image_"1].submit()} function upload_completed(){ document.last.submit(); } function check_uploads(){ if(uploaded==uploads){ upload_completed(); }} function upload_complete(id){ var x=document.getElementById("image_upload_result"+id); x.innerHTML="Upload Complete"; uploaded+=1; check_uploads(); } </script> and in the <body> i have <div id="image_upload_result1"> <form method="post" action="mysite.com/?page=Gallery&action=Uploader" target="the_uploader_1" name="form_image_1"> <input type="hidden" name="MAX_FILE_SIZE" value="4608" /> <input type="hidden" name="id" value="1" /> <p class="meta">Image <b>1</b> </p>Image Name; <input name="image_name" value="" /> <br />Image Desc; <input name="image_desc" value="" /><br /> <input type="file" name="image"/> <iframe id="uploader_1" name="the_uploader_1" style="width:0px; height:0px; border: 0px" src=""></iframe> <br /><br /></form></div> <a href="javascript:void(0);" onClick="start_uploads();">Start Uploading</a> As you may see i have been trying to upload a image into a hidden IFRAME. Please can someone point out where i have gone and some good sites to learn form. I have already gone though w2schools about 5 times. Thankyou all in advance Paul Link to comment https://forums.phpfreaks.com/topic/163493-new-to-javascript-simple-variaboles/#findComment-862829 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.