View Full Version : using onClick event with a button and textbox...

Nov 23rd, 2005, 07:14 AM
hi all...

let me describe my prob, hope you can understand it... :o

let say, i have a form, with some textboxes, buttons and others....

and there's this one particular textbox, with a button beside it.
when i click on the button, i want the current server time to appear in the textbox, without affecting other textboxes [or any other form attributes within that form].
i think i need to use the onClick event, but i dunno how.

can anybody help me on this? thanx in advance ;)

Nov 23rd, 2005, 07:18 AM
i want the current server time to appear in the textbox,
May I ask for a one good reason why?

Nov 23rd, 2005, 07:21 AM
errr actually my supervisor ask me on this, he needs my help.
it's for his project to build a website for the department (for business purpose).

Nov 23rd, 2005, 01:46 PM
Bolded items are major areas to learn...

function myFunction()
var dateTime=new Date();
<input type='text' id='myText' value='' size='60'>
<input type='button' onClick='myFunction()' value='Click for Time'>
Although read up on Date object to get what you want...

Nov 25th, 2005, 02:46 AM
hye pyth..

thanx for ur help. i'll try the codes u gave. ;)
n thanx for the advice too :)