himmat.m4 0 Junior Poster in Training

Plz tell me,

how to display number of value get form javascript function at every call on the jsp page.

suppose in following code
I m displaying IdNo var on jsp page in input text at call changeImage(IdNo) and here when next time call this fun then aganin overlaps value in input text.
so here i want to display number of values in input text at every call fun like-
1 SE W,1 SE W, 1 SE W ............

code is

<SCRIPT LANGUAGE="JavaScript">
   
    if(document.images)
        {
            var selectedSeat = new Image();
            selectedSeat.src = "images/nice.jpg";

            var freeSeat = new Image();
            freeSeat.src = "images/bus.jpg";
        }
        function changeImage(IdNo)
        {
            document.getElementById("tx").value = IdNo;
            //var p = <%=request.getContextPath()%>;
            //alert("path is ")
            var imgName = document.getElementById(IdNo).name
            
           
            if(document.images)
                {
                    
                    var currentImg = document[imgName].src;
                    var freeImg = "http://localhost:8084/OnlineTravel/images/bus.jpg";
                    //var freeImg = "<%=request.getContextPath()%>/images/bus.jpg";
                    if(currentImg==freeImg)
                        {
                            document[imgName].src = selectedSeat.src;
                        }else
                            {
                                document[imgName].src = freeSeat.src;
                            }
                            
                }
        }
    </SCRIPT>

<img src="images/bus.jpg" alt="" class="borderHidden" name="Image1" width="28" height="28" onclick="changeImage(id)" id="1 SE W">

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.