ok here it goes:


I ahve 2 textbox within a form on my HTML page


I want to display the text "SHOUVIK" (without quotes) on the second textbox as soon as I click on the first textbox


Is this possible?

Kindy help

Recommended Answers

All 2 Replies

I want to display the text "SHOUVIK" (without quotes) on the second textbox as soon as I click on the first textbox

Make sure that both textboxes have "name" (for older browsers) and "id" attributes.

Add the following to the first textbox:

onfocus="document.forms[0].second_box_name.value='SHOUVIK';"

Thanx mate, that helped

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.