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

Helper for TextBox

9 Answers 995 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 16 Jul 2014, 01:06 AM
Is there a helper for TextBox? I tried using AutoComplete, but I think it's an over kill and it does not cache entries like Text Boxes, so it functions differently and may confuse users.

Thanks
Alex

9 Answers, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 17 Jul 2014, 11:12 AM
Hello Alex,

I am happy to inform you that we introduced such an Html helper in our UI for ASP.NET MVC suite starting Q2 2014 (v.2014.2.716). You can use it in the following way:

//Razor syntax  
 @(Html.Kendo().TextBox()
     .Name("kTextBox")
     .Value("Test")
   )

Best regards,
Sebastian
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Alex
Top achievements
Rank 1
answered on 18 Jul 2014, 12:44 AM
I downloaded and upgraded my solution, but I don;'t see .TextBox......
0
Sebastian
Telerik team
answered on 18 Jul 2014, 08:08 AM
Hello again Alex,

Can you double-check that you updated the assembly references in your project to reference the 2014.2.716 version in it? I tested this simple example again and it work as expected, using the VS Extensions New Project wizard for web application boilerplate.

Regards,
Sebastian
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Victor
Top achievements
Rank 1
answered on 16 May 2017, 11:37 PM
great!  why does it not include EVENTS?  Like the numeric textbox does?  AND why is the NUMERIC textbox (which has an events field) so over documented?
0
Victor
Top achievements
Rank 1
answered on 16 May 2017, 11:39 PM

To be clear:

 @(Html.Kendo().TextBox()
     .Name("kTextBox")
     .Value("Test")

     .Events(....)  <--- does not exist
   )

0
Konstantin Dikov
Telerik team
answered on 19 May 2017, 05:36 AM
Hello Victor,

The TextBox helper was introduced for unifying the styles of the simple input element with other helpers from the UI for ASP.NET MVC suite. If you need to handle some events of the input element you could attach the handlers through the HtmlAttributes or with jQuery after the rendering of the element. 


Regards,
Konstantin Dikov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Jim
Top achievements
Rank 1
answered on 29 Nov 2018, 01:31 PM

I know this is an old thread but I ran into the same limitation with Events not working for the TextBox helper. In my case I was trying to "unify the styles of the simple input element with other helpers" as you say so had code like this:

@(Html.Kendo().DateTimePicker()
    .Name("myDateTimePicker")
    .Events(e =>
    {
        e.Change("onChangeMyDateTimePicker");
    })
)
@(Html.Kendo().TextBox()
    .Name("myTextBox")
    .Events(e =>
    {
        e.Change("onChangeMyTextBox");  // this fails
    })
)

function onChangeMyDateTimePicker() {
    let newDateTime = this.value();

    // do something with it
}

and of course the second part failed, so I had to do it as you suggested like this:

$(document).ready(function () {
    $("#myTextBox").change(onChangeMyTextBox);
});

 

function onChangeMyTextBox() {

    let newText = $("#myTextBox").val();
    // do something with it
 }

OK, fine, it works, but it doesn't feel very unified.

0
Konstantin Dikov
Telerik team
answered on 03 Dec 2018, 08:25 AM
Hello Jim,

The TextBox helper does not expose built-in events, but if you thing that this will be a good addition to the suite, you could create a feature request in our feedback portal:

Best Regards,
Konstantin Dikov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Jim
Top achievements
Rank 1
answered on 03 Dec 2018, 12:51 PM
Done!
Tags
General Discussions
Asked by
Alex
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Alex
Top achievements
Rank 1
Victor
Top achievements
Rank 1
Konstantin Dikov
Telerik team
Jim
Top achievements
Rank 1
Share this question
or