Page 1 of 1

Setting input default value

Posted: Sat Mar 16, 2013 5:19 am
by Mike5654406

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.


Setting input default value

Posted: Sun Mar 17, 2013 1:12 am
by maxkatz

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.


Setting input default value

Posted: Sun Mar 17, 2013 2:04 pm
by Mike5654406

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.


Setting input default value

Posted: Mon Mar 18, 2013 3:03 am
by maxkatz

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


Setting input default value

Posted: Mon Mar 18, 2013 3:15 am
by Mike5654406

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.


Setting input default value

Posted: Mon Mar 18, 2013 3:23 am
by maxkatz

Check of those attributes are rendered in the source.


Setting input default value

Posted: Mon Mar 18, 2013 3:40 am
by Mike5654406

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.


Setting input default value

Posted: Mon Mar 18, 2013 8:49 am
by Kateryna Grynko

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.