Debt Consolidation - Find jobs - Communications Technology Articles - Wordpress Theme - Reference 2007

PDA

View Full Version : display return value of the function in a texbox


claudi
Dec 11th 2007, 1:43 am
<html>
<head>

<script type="text/javascript">
function FormatXMLTime(aTime)
{
// Extract the date
//
var date = aTime.substring(0, aTime.indexOf("T", 0));

// Remove the date.
//
var temp = aTime.replace(date, "");
var temptime = temp.replace("T", "");

// Extract the time.
//
var time = temptime.substring(0, temptime.indexOf("-", 0));

return time;
// return date + " " + time;
}
</script>

</head>
<body>

<form>
<input type="button"
onclick="FormatXMLTime('2007-12-04T09:26:59.953+00:00')"
value="Call function">
</form>


</body>
</html>

I have this code in my html file and I need the return value to be display in a textbox; is it possible?

hrcerqueira
Dec 11th 2007, 5:12 am
like this:

<input type="button" onclick="alert(FormatXMLTime('2007-12-04T09:26:59.953+00:00'))" value="Call function">

?