I want to use a radiobutton as an additional field in the radUpload control.
I wish to force the user to select either of two choices.
I have created the javascript so they show up correctly on the page, but I cannot access the values from the UploadedFiles collection.
here is the java to create the additional fields.
and here is where i am trying to get the additional fields values.
I wish to force the user to select either of two choices.
I have created the javascript so they show up correctly on the page, but I cannot access the values from the UploadedFiles collection.
here is the java to create the additional fields.
var numberOfCustomFields = 0; |
function OnClientAddedHandler(sender, eventArgs) |
{ |
var inputRow = eventArgs.get_row(); |
var uList = inputRow.parentNode; |
var count = 0; |
//new row for a User Manual Category check box |
newRow = document.createElement("li"); |
count++; |
uList.insertBefore(newRow, inputRow); |
var label = document.createElement("span"); |
label.innerHTML = "Manuals/Add. info"; |
label.style.fontSize = 12; |
input = document.createElement("input"); |
input.type = "radio"; |
input.name = "group" + count; |
input.id = sender.getID("radUserManual"); |
newRow.appendChild(input); |
newRow.appendChild(label); |
//new row for a Cut-Sheets Category check box |
newRow = document.createElement("li"); |
count++; |
uList.insertBefore(newRow, inputRow); |
var label = document.createElement("span"); |
label.innerHTML = "FFE Cut Sheet"; |
label.style.fontSize = 12; |
input = document.createElement("input"); |
input.type = "radio"; |
input.name = "group"+ count; |
input.id = sender.getID("radCutSheet"); |
newRow.appendChild(input); |
newRow.appendChild(label); |
// Set the number of fields from the count |
numberOfCustomFields = count; |
} |
function OnClientDeletingHandler(sender, eventArgs) |
{ |
var input = eventArgs.get_fileInputField(); |
deleteCustomFields(input); |
} |
function OnClientDeletingSelectedHandler(sender, eventArgs) |
{ |
var inputs = eventArgs.get_fileInputFields(); |
for (i = 0; i < inputs.length; i++) |
{ |
deleteCustomFields(inputs[i]); |
} |
eventArgs.set_cancel(true); |
} |
function deleteCustomFields(input) |
{ |
var li = input.parentNode.parentNode; |
var ul = input.parentNode.parentNode.parentNode; |
for (var i = 0; i < numberOfCustomFields; i++) |
{ |
ul.removeChild(li.previousSibling); |
} |
ul.removeChild(li); |
} |
and here is where i am trying to get the additional fields values.
For Each f As Telerik.Web.UI.UploadedFile In RadUpload1.UploadedFiles |
If f.GetIsFieldChecked("radCutSheet") Then |
sCategory = "Cutsheet" |
ElseIf f.GetIsFieldChecked("radUserManual") Then |
sCategory = "User Manual" |
End If |
If Directory.Exists(strPath & Replace(txtStockNumber.Text.Trim, "-", "") & "/") Then |
f.SaveAs(strPath & Replace(txtStockNumber.Text.Trim, "-", "") & "/" & f.GetName, True) |
Else |
Directory.CreateDirectory(strPath & Replace(txtStockNumber.Text.Trim, "-", "") & "/") |
f.SaveAs(strPath & Replace(txtStockNumber.Text.Trim, "-", "") & "/" & f.GetName, True) |
End If |
'Insert record into the database - because this file may exists we need to create a stored proc |
'that will do an insert or an update. |
'StoreNameinDB(strPath & Replace(txtStockNumber.Text.Trim, "-", "") & "/" & f.GetName, sCategory) |
Next |