SibSoft Ltd.
Development Services
software products
 RegisterRegister    SearchSearch   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
EZYWebhost - Cheap XUpload & XFileSharing 100% campatible hosting

AJAX upload progress bar

File sharing script
Only allow one choice checkbox at a time.

 
Post new topic   Reply to topic    SibSoft Ltd Forum Index -> XUpload
View previous topic :: View next topic  
Author Message
ap



Joined: 08 Jan 2007
Posts: 21

PostPosted: Jan 18, 2007 9:54 pm    Post subject: Only allow one choice checkbox at a time. Reply with quote

Is it possible to program the upload_form to only allow one selection in the checkboxes at a time? I have users who select two checkboxes; the system displays a generic window that says transfer complete. The user is not sure what happens and clicks again. Eventually, the file does get uploaded. Better if they are only allowed to make one selection at a time, if they choose the first one, then the others get blanked out, etc.
Back to top
View user's profile Send private message
PilgrimX182



Joined: 22 Mar 2006
Posts: 1107
Location: Undisclosed location

PostPosted: Jan 19, 2007 6:55 am    Post subject: Reply with quote

Good idea man! Will use radiobuttons.

To allow only one progress bar mode choose one checkbox and add
Code:
checked style="display: none;"

to the end of tag.

After that you can comment/romove other checkboxes.
Back to top
View user's profile Send private message Visit poster's website AIM Address
ap



Joined: 08 Jan 2007
Posts: 21

PostPosted: Jan 19, 2007 4:03 pm    Post subject: Reply with quote

Thanks, That worked if I only want one selected. However I need to give the users a choice and have them check only one and not both. Any quick fix ideas.
Back to top
View user's profile Send private message
ap



Joined: 08 Jan 2007
Posts: 21

PostPosted: Jan 19, 2007 4:30 pm    Post subject: Reply with quote

Hey, Just figured it out. Add the following to the upload_form.html script.

This first part gets placed before the </head> line.

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
function checkBoxValidate(cb) {
for (j = 0; j < 2; j++) {
if (eval("document.F1Upload.box[" + j + "].checked") == true) {
document.F1Upload.box[j].checked = false;
if (j == cb) {
document.F1Upload.box[j].checked = true;
}
}
}
}
// End -->
</script>


Replace your checkboxes with this for each checkbox...

<Input type="checkbox" name="popup" id="box" onClick="javascript:checkBoxValidate(0)">

<Input type="checkbox" name="inline" id="box" checked onClick="javascript:checkBoxValidate(1)">


I only have two check boxes. If you are using all three, add and change the last checkbox to <Input type="checkbox" name="inline" id="box" checked onClick="javascript:checkBoxValidate(3)">. Also, the scirpt you placed at the top should be changed to <3 and so on for as many checkboxes as you have.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SibSoft Ltd Forum Index -> XUpload All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group