Mike5654406
Posts: 0
Joined: Fri Mar 15, 2013 10:12 pm

Setting input default value

What is the process for setting an inputs default value? Not placeholder - but value = "1" for example? Also how do you set a min and/or a max value for an input? I have attempted to do this via More Properties, but I get an error. Any example would be helpful. Thanks.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Setting input default value

You can set default value in Properties (set the Text property). You can also set the default value via JavaScript -- for example on page load.

The input component doesn't have min/max value property. You can add validation to check for min/max value.

Mike5654406
Posts: 0
Joined: Fri Mar 15, 2013 10:12 pm

Setting input default value

Would you be able to provide a quick example of setting this value via JavaScript?

Also-
How would I implement the following example in Tiggzi?

http://stackoverflow.com/questions/10...

I am unable to add min="0" via More Properties and the HTML is not editable. What is the suggested approach? Thank you.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Setting input default value

Sorry, I was wrong. The input element does support min/max values, based on the link. You can set those using More Properties

Mike5654406
Posts: 0
Joined: Fri Mar 15, 2013 10:12 pm

Setting input default value

I am unable to set these via more properties. please attempt to set min to a value of 0 and see if you are able to. thank you.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Setting input default value

Check of those attributes are rendered in the source.

Mike5654406
Posts: 0
Joined: Fri Mar 15, 2013 10:12 pm

Setting input default value

Ok, but I am not sure if you are saying this can or can not be set via more properties. is this a bug, or are these not meant to be set in this manner?
rendered in source - can you please elaborate?
thank you.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Setting input default value

Hi Mike,

It's a bug. As a workaround you can on page Load add "Run JavaScript" action with the following code:

codeTiggzi("textinput1").attr("min", "0");/code
where "textinput1" is a Tiggzi component name.

Return to “Issues”