1

I cannot get the mask control to entirely work. A simple mvc editorfor line like this shows fails to mask the input. I'm sending a timespan value to it.

@Html.EditorFor(model => model.VXChargeBO.VisitTime)

should mask like this _ _ : _ _ Instead it just shows the time passed as 00:00:00

I've tried adjusting the mask, but the problem seems to be in MVC or CSS I wanted to rule out MVC.

  • Welcome to Stackoverflow. You will probably have to give a lot more detail for anyone to be able to help you (e.g. I cannot even guess what programming language you are working with, yet alone what framework you are using, etc.). Furthermore, on Stackoverflow it is considered to be good practice to show what you have already tried on your own to solve the problem (for example by showing some code). – helmbert Feb 10 '13 at 19:45
  • This is Microsoft MVC. The language is razor. I figured out the answer already. I'll post it soon as the system allows me. – James Bailey Feb 11 '13 at 08:07
  • I applied this mask using a razor TextBoxFor and the following: $.mask.definitions['h'] = "[0-2]"; $.mask.definitions['m'] = "[0-5]"; $("#VXChargeBO_VisitTimeIN").mask("h9:m9", { completed: function () { CalcVisitTime(this.val(),0); } }); $("#VXChargeBO_VisitTimeOUT").mask("h9:m9", { completed: function () { CalcVisitTime(0,this.val()); } }); – James Bailey Apr 19 '13 at 18:05

1 Answers1

0

Use:

@Html.TextBoxFor(model => model.VXChargeBO.VisitTime)
slm
  • 15,396
  • 12
  • 109
  • 124