This is a migrated thread and some comments may be shown as answers.

How to get values of additional fields client side

2 Answers 113 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Julie
Top achievements
Rank 1
Julie asked on 26 Apr 2009, 08:03 PM
Hi Telerik Support,
    I have been working with the Upload control, and do not see how to get the values of the additional fields before postback.
    I would like to validate the information before they submit to the server.  I tried using OnClientSubmitting,  but have not been able to figure out how to get to my control which is a description field an example on how I would accomplish this would be greatly appreciated. 
Thanks in advance for the help.
Julie

2 Answers, 1 is accepted

Sort by
0
Accepted
Genady Sergeev
Telerik team
answered on 29 Apr 2009, 09:35 AM
Hi Julie,

You can use the $get function to obtain the desired html element. Example: Consider having the following function that adds a description text box to every single file input.

function onClientAddedHandler(sender, eventArgs) {
            var inputRow = eventArgs.get_row();
            var uList = inputRow.parentNode;

            // add desctiption input
            rowDescription = document.createElement("li");
            uList.insertBefore(rowDescription, inputRow);

            var inputDesc = document.createElement("input");
            inputDesc.type = "text";
            inputDesc.id = inputDesc.name = sender.getID("description");

            rowDescription.appendChild(labelDesc);
            rowDescription.appendChild(inputDesc);
        }

So, the ID of the added input is compound of the Parent control id + "description". This is, if  your upload
ID is RadUpload1, then the id of the input is RadUpload1description0/1/2/3/4 etc.

For your convenience I have prepared sample demo demonstrating the approach. You can find it as an attachment.

Regards,
Genady Sergeev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Julie
Top achievements
Rank 1
answered on 01 May 2009, 04:13 PM
Thanks for the help Genady!!!
Tags
Upload (Obsolete)
Asked by
Julie
Top achievements
Rank 1
Answers by
Genady Sergeev
Telerik team
Julie
Top achievements
Rank 1
Share this question
or