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

Webshims Required Field

6 Answers 39 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Russ
Top achievements
Rank 1
Russ asked on 11 Jun 2013, 03:46 PM
I am using this framework for validation in my web app.  I'm trying to set a RadComboBox to required using the required attribute.  The problem is that field never identifies as "required" when empty.  I believe the reason is the control is defined as below and I'm adding a required attribute with the following javascript:

$('#ctl00_MainContent_LRS_pi_1_ddlProductCDF_Input').attr('required', 'required');

The issue I believe is related to the fact that ctl00_MainContent_LRS_pi_1_ddlProductCDF_Input is set to readonly.  It works when I allow CustomText using the same code but that's not really what I want.  I can't use the RadDropdownList or regular DropdownList b/c I need separators for items in my dropdown so I'm left with the RadComboBox.  Is there something I'm missing?

I have a demo of the problem but I can't attach it here.
  <div id="ctl00_MainContent_LRS_pi_1_ddlProductCDF" class="RadComboBox RadComboBox_Office2010Blue" style="width:100px;">
 <table summary="combobox" style="border-width:0;border-collapse:collapse;table-layout:fixed;width:100%">
  <tr class="rcbReadOnly">
   <td class="rcbInputCell rcbInputCellLeft" style="margin-top:-1px;margin-bottom:-1px;width:100%;"><input name="ctl00$MainContent$LRS_pi_1$ddlProductCDF" type="text" class="rcbInput radPreventDecorate" id="ctl00_MainContent_LRS_pi_1_ddlProductCDF_Input" value="" style="display: block;" readonly="readonly" tabindex="30" /></td><td class="rcbArrowCell rcbArrowCellRight" style="margin-top:-1px;margin-bottom:-1px;"><a id="ctl00_MainContent_LRS_pi_1_ddlProductCDF_Arrow" style="overflow: hidden;display: block;position: relative;outline: none;">select</a></td>
  </tr>
 </table><div class="rcbSlide" style="z-index:6000;"><div id="ctl00_MainContent_LRS_pi_1_ddlProductCDF_DropDown" class="RadComboBoxDropDown RadComboBoxDropDown_Office2010Blue " style="float:left;display:none;"><div class="rcbScroll rcbWidth" style="width:100%;"><ul class="rcbList" style="list-style:none;margin:0;padding:0;zoom:1;"><li class="rcbItem "></li><li class="rcbItem  rcbSeparator ">Assets</li><li class="rcbItem ">DRS</li><li class="rcbItem ">VPS</li><li class="rcbItem ">VPS/TCPIP</li></ul></div></div></div><input id="ctl00_MainContent_LRS_pi_1_ddlProductCDF_ClientState" name="ctl00_MainContent_LRS_pi_1_ddlProductCDF_ClientState" type="hidden" />
</div>

6 Answers, 1 is accepted

Sort by
0
Russ
Top achievements
Rank 1
answered on 14 Jun 2013, 02:33 AM
Changing the RadComboBox to native mode does allow the required attribute to be validated.  The RadDropdownList doesn't correctly validate the required attribute in any mode.  I have a feeling that as part of the changes you are making for migrating the controls HTML5 and CSS3 that these are issues you know about. 
0
Plamen
Telerik team
answered on 14 Jun 2013, 01:50 PM
Hi Russ,

 
Would you please specify which one of the suggested validations in this on-line demo are you trying to achieve because it is not quite clear from the provided so far information?

Please also refer to this help topic where is show how similar behavior can be done with RequiredFiedValidator and the value of RadComboBox.

If you r scenario is somehow different please elaborate a little bit so we could be more helpful.

Regards,
Plamen
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Russ
Top achievements
Rank 1
answered on 19 Jun 2013, 03:39 PM
Plamen,

While I'm aware that I can use ASP.NET Validators to accomplish the same thing, we are looking at a pure javascript solution.  As part of that the required attribute, as part of the HTML 5 spec, indicates that when that field is set, the value field is updateable and the value field is empty, the form will stop processing and indicate that the field is required. 

The reason for the use of required in our solution is the extra controls and setup it takes for our developers.  By simply placing a required attribute on the field, the validation works without any extra thinking/coding on the developers part.  If you would like I can send you a sample project showing you the issue.

Russ
0
Plamen
Telerik team
answered on 24 Jun 2013, 03:06 PM
Hi Russ,

 
Would you please be that kind and send us a sample page indeed s owe could inspect the issue and be more helpful?

Regards,
Plamen
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Russ
Top achievements
Rank 1
answered on 24 Jun 2013, 06:19 PM
I've opened up a support ticket: 708522
0
Plamen
Telerik team
answered on 27 Jun 2013, 07:02 AM
Hello,

 
We have inspected the issue in the support ticket and the desired functionality is working as expected if the MarkFirstMatch="true" property of RadCombobox is set. 

Regards,
Plamen
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
ComboBox
Asked by
Russ
Top achievements
Rank 1
Answers by
Russ
Top achievements
Rank 1
Plamen
Telerik team
Share this question
or