View Full Version : Check if textbox has data, if so, show image

08-24-2007, 08:19 PM
Hi everyone,

I have another question. I am more of an HTML, CSS designer, so I don't know how to hand-code javascript very well, but I'm trying to learn. Here is my question:

If a certain textbox has text in it, then
Display/Show a checkmark icon a navigation tab on my menu bar. (This is just to let the user now that there is information from that textbox also listed on the "checkmarked" page.)

If the textbox is empty, then
don't display the checkmark on the nav tab.

<script language="JavaScript">
function CheckTextbox() {

var txtName;

// first set a reference to the textbox
txtName = document.getElementById('txtName');

// check if the textbox is NOT blank
if (txtAD.value != ''") {

code here for if textbox has text in it and then show the checkmark icon


else {

code here for if the txtName textbox is empty, do not display the icon on the nav tab.


Could someone help me with this?

Thanks very much!