Check out this example file:
<abs contexttype="opengear" gridsize="20" style="">
<meta>
<params>
<param access="1" maxlength="0" name="cddisplay" oid="cddisplay" stateless="true" type="STRING" value="40:00" widget="label"/>
<param access="1" maxlength="0" name="cdvalue" oid="cdvalue" type="STRING" value="50:00" widget="text"/>
</params>
</meta>
<timer autostart="false" id="cdtimer" pattern="mm:ss" rate="500" start="999:59" stop="00:00">
<timertask tasktype="ogparamset">params.setValue('cddisplay', 0, event.getDisplay());</timertask>
</timer>
<param expand="true" height="60" left="40" oid="cddisplay" style="style:timerLabel" top="40" width="120"/>
<param expand="true" height="60" left="40" oid="cdvalue" top="120" width="120"/>
<button buttontype="push" height="60" left="180" name="Start / Pause" top="40" width="120">
<task tasktype="ogscript">var timer = ogscript.getTimerManager().getTimer("cdtimer");
if (!timer.isRunning())
{
timer.startTimer(false);
}
else
{
timer.stopTimer(false);
}</task>
</button>
<button buttontype="push" height="60" left="180" name="Set Countdown" top="120" width="120">
<task tasktype="timercontrol">var startValue = params.getValue('cdvalue', 0);
var timer = ogscript.getTimerManager().getTimer('cdtimer');
var parsedStartValue = timer.getFormat().parseObject(startValue);
timer.setStart(parsedStartValue);
timer.setTime(parsedStartValue);</task>
</button>
<button buttontype="push" height="140" left="320" name="Reset" top="40" width="80">
<task tasktype="ogscript">var timer = ogscript.getTimerManager().getTimer('cdtimer');
timer.resetTimer();</task>
</button>
</abs>
The relevant script is in the "Set Countdown" button (note that you'll probably want to remove the call to "setStart" for how you are using things)
var startValue = params.getValue('cdvalue', 0); //Get the text value of the time
var timer = ogscript.getTimerManager().getTimer('cdtimer'); //Get the timer
var parsedStartValue = timer.getFormat().parseObject(startValue); //Parse the text using the same format (mm:ss) as the timer
timer.setStart(parsedStartValue); //You'll probably want to remove this the way you are using it
timer.setTime(parsedStartValue); //Set the current time#DashBoard