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
|
|
|
|
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 |
|
|
|
|
Rank: Member
Groups: Member
Joined: 8/14/2006(UTC) Posts: 3
|
Thank You Now everything works.
|
|
|
|
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.