Spinner default value

Get help with using Metro 4 components
Post Reply
User avatar
LoveM4
Posts: 2
Joined: Thu Mar 28, 2019 2:22 pm
Status: Offline

Spinner default value

Post by LoveM4 » Thu Mar 28, 2019 2:48 pm

Hi all, my name is Alexander and I am a new member. Really enjoy playing with Metro UI and its soo easy to use it, in short I love it :)

Now I have one question, when I put data-default-value inside spinner ( https://metroui.org.ua/spinner.html ) nothing is happening. Its still showing me default value which is 0.

Example: <input name='maxage' type='text' data-role='spinner' data-default-value='99' data-min-value='18' data-max-value='99' value=''>

Am I missing something or doing something wrong? Everything is working fine, I am only having problem with default value.

Thanks :)

User avatar
olton
Site Admin
Posts: 205
Joined: Mon Apr 09, 2018 6:19 pm
Location: Kiev, Ukraine
Status: Offline

Post by olton » Thu Mar 28, 2019 3:01 pm

use value attribute

User avatar
LoveM4
Posts: 2
Joined: Thu Mar 28, 2019 2:22 pm
Status: Offline

Post by LoveM4 » Thu Mar 28, 2019 3:52 pm

OMG I just realized that I made very dumb question hahahaha

Reason why value='' is empty is because of php code, now I solved problem and set default value via php. IF and Else did that job :)

Sorry, I am not coder and I dont think like them and I am beginner in all of this :)

Code: Select all


if (isset($_GET["maxage"]) && $_GET["maxage"])
  {
    $maxAge = $_GET["maxage"];
  }
  else
  {
    $maxAge = "99";
  }

I really need to think twice before I post dumb questions like this. Sorry for taking your time olton and thank you very much for your help :)

Post Reply