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

input with same name on different forms on the same page

1 Answer 11 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Iron
Veteran
Dan asked on 02 Apr 2021, 02:37 PM

I have a requirement that on a page that already contains a number of widgets to display a window that contains the same widgets.

The problem is that the page and the partial view loaded in the window are created using

@Html.Kendo().XXXFor(m => m.Property)....

and have discovered that when I load the window the widget on the page disappear and the widget on the window is not created. Also there are a lot of errors in the kendo code.

Is there a way to change the name that is required by the telerik but to leave the input names as they are?

1 Answer, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 07 Apr 2021, 12:42 PM

Hello Dan,

When multiple widgets with the same id are initialized on the page the observed behavior will occur. As described in our documentation the Name option will be used to set the id and the name attributes of the rendered element. The Name options of the helpers have to be always unique in the context of the whole web page. You could read more in the article linked below:

https://docs.telerik.com/aspnet-mvc/getting-started/helper-basics/fundamentals#basic-configuration

You could set a different id and name to the elements using the Name() option, however, I am afraid that this will also set different name attribute to the input fields. 

Regards,
Neli
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
General Discussions
Asked by
Dan
Top achievements
Rank 1
Iron
Veteran
Answers by
Neli
Telerik team
Share this question
or