Set min value for numeric textbox in Kendo ui template - kendo-ui

I need to prevent negative values in Kendo numeric textbox template as below:
<input type="text" data-type="number" data-format="n0" name="SnoozeLength" data-bind="value:snoozeLength" data-role="numerictextbox" />
is there any attributes which i can use line "min-value= 0"

Try with the following:
http://docs.telerik.com/kendo-ui/api/web/numerictextbox#configuration-min
You can specify min configuration for your numerictextbox.
Best Regards,

Related

Spring Freemarker Form Bind : Problem with Exponent Value

I have Spring bind form with freemarker. But large number show Exponent value. How to show value without Exponent.
For small numeber...
<#spring.formInput 'CaseMaster.year' 'placeholder="e.g. 2013" ' 'number'/>
For large number...
<#spring.formInput 'CaseMaster.suitValue' 'placeholder="e.g. Suit Value" ' />
HTML View:
I wnat to show value like 80000000 or 80000000.00 or like 8,00,00,000.00 in the second field.
I've dug down into the macro and it looks like you have no control over the formatting to the populated value. Perhaps there's a more elegant solution, but at this point, you might try creating your own macro that gives you formatting control. (This is untested.)
<#macro numberInput path attributes="">
<#spring.bind path/>
<input type="text"
id="${status.expression?replace('[','')?replace(']','')}"
name="${status.expression}" value="status.value?c" ${attributes}<#closeTag/>
</#macro>
You would call it like this:
<#numberInput 'CaseMaster.suitValue' 'placeholder="e.g. Suit Value" ' />

Jqgrid colNames set from a jsp hidden variable

I have a jqgrid whose column Name I wish to set from a jsp hidden variable.
<input type="hidden" name="columns" id="columns" value= "<%= finalColumns %>"></input>
This hidden id columns has the values:
value="'Master Code','Mst. Code Description','Master Code Status','Master Code Groups','Detail Code Groups','No. of Detail Codes','Length','Attribute Type','sample'" .
Now I am trying in my Javascript like
colNames:'['+$("#columns").val()+']',
But I am getting an alert box saying Length of colNames <> colModel.
I have checked, there are 9 col models and 9 values are present in the string. Where am I doing some mistake
UPDATE:SOLUTION :
I tried using
eval(('['+$("#columns").val()+']').toString()).
That solved the problem. I have to understand Why this solves the problem
Thanks anyways

XPATH required for an input text field?

i have a text box in my web application,Where i need to give input. I am trying to find the xpath of the text box. the following error is thrown.
Unable to locate element: {"method":"xpath","selector":"
HTML code:
<div class="input">
<input id="firstName" class="long" type="text" maxlength="50" value="" name="firstName
I want the xpath for firstName textbox.
//input[#type='text']
And this for generally targeting a text input (what I was after)
Try this one:
//input[#id='firstName']
Explanation:
// search on all levels
input for element nodes with the name of "input"
[#id='firstName'] having an attribute (#) with the name of "id" and a value of "firstName"
at least 3 simple ways to get this:
1)Driver.FindElement(By.XPath("//input[#id='firstName']"));
2)Driver.FindElement(By.Id("firstName"));
3)Driver.FindElement(By.CssSelector("#firstName"));
//*[text()[contains(.,'firstName')]]
finding by text would always work.

How to fetch value usin VBS script for the below?

<input type="text" value="Phone" name="Phone" />
I can't set using Id as like below. I dont have rights to change the tag as well. Is ther any option using name value inorder to set value?
Set Helem=IE.document.getElementByValue("Phone")
Helem.Value = "1234565678"
Assuming IE in your sample is some instance of internet explorer or Shell.Application, use the following sintax
Set Helem = IE.document.getElementsByName("Phone")
And it will not return a reference to the element, but a HTMLCollection of elements. From your code, it can be, more or less, handled as as array. Assuming there is only one element with that name, reference to it will be in Helem(0)

Validating input type number in html5

I want to restrict entry of input onto a field of type number such that input cannot be outside range of min-max specified in the html.
input type = "number" min = "1" max = "5"
Is there a way of outputting the number field without the text box and i would rather not use
"input type = range"
as slider does not show value currently selected
Please help.
Thanks.
Based on what you said, I suggest using a simple input text field and check it's value validity on submission via JavaScript (as #Kush mentions above). You could also check it as the user types, or moves focus away from that field.
<form>
Only 1 to 100 <input type="text" name="number" pattern="\d{1,2}(?!\d)|100" title="one to hundreed only">
<input type="submit">
</form>

Resources