Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
hastur  
#1 Posted : Thursday, August 17, 2006 6:43:13 PM(UTC)
hastur

Rank: Member

Groups: Member
Joined: 8/14/2006(UTC)
Posts: 3

Hi

I need to force the users to suply additonal information in an input field before uploading. My plan is to give the user an alert and then stopping the upload.

How do I stop the upload?

My Code:

Code:
Heading: <input id="Heading" name="Heading" type="text" size="50" /><br><br>
	<script type="text/javascript">
		function beforeUploadHandler() {
			var pageNrText = new String( Request.QueryString["id"]); 
			getImageUploader("ImageUploader1").AddField("PageNr", pageNrText);		
			
			var headingBox = document.getElementById("Heading");
			var headingText = headingBox.value;
			getImageUploader("ImageUploader1").AddField("Heading", headingText);
			
			if(headingText == ""){		
				alert("You must enter a heading");	
			}
		}

		//<![CDATA[
		//Create JavaScript object that will embed Image Uploader to the page.
		
		var iu = new ImageUploaderWriter("ImageUploader1", 580, 400);

		<--- etc --->

Edited by user Tuesday, February 19, 2008 1:06:05 PM(UTC)  | Reason: Not specified

Alex Makhov  
#2 Posted : Thursday, August 17, 2006 8:46:40 PM(UTC)
Alex Makhov

Rank: Advanced Member

Groups: Member
Joined: 8/3/2003(UTC)
Posts: 998

Hello,

Here is the corrected variant of your code:

Code:
if(headingText == ""){ 
    alert("You must enter a heading"); 
    return false;
}
else{
    return true;
}

Edited by user Tuesday, February 19, 2008 1:07:05 PM(UTC)  | Reason: Not specified

Sincerely yours,

Alex Makhov

UserPostedImage Follow Aurigma on Twitter!

hastur  
#3 Posted : Thursday, August 17, 2006 8:56:08 PM(UTC)
hastur

Rank: Member

Groups: Member
Joined: 8/14/2006(UTC)
Posts: 3

Thank You

Now everything works.

Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.