Skip to main content

How to add a autocomplete textbox to a jsp page by clicking on a button

2 replies [Last post]
Joined: 2008-07-21


I am new at jmaki and am facing a problem.
My problem goes like this, I have a Try.jsp which contains a jmaki yahoo button called Add.On clicking Add button it should create a jmaki yahoo autocomplete textbox and a textarea in a row above Add button in Try.jsp. Each time
Add button is clicked above two widgets should get created in next row. Try.jsp contains save button,clicking on which should save all the data.

I have no idea how to do it.Can anyone help me out.

Thanks in advance


Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2003-07-31

Hi Vinay,

I would try having the autocomplete texbox in a dcontainer.


You can set the contents of the dcontainer with something like:

The autocompleter page can contain the yahoo.autocomplete widget.

Also see:

Joined: 2008-07-21

Thank you very much Greg.

I managed to solve the problem couple of days earlier.
I created a row consisting of a div tag and a textbox. In that div tag i loaded autocomplete widget programatically.

On button click in jsp i am invoking addrow method in java script file
jsp file :

My javascript file contains :
var count = "1";
var count_row = 0;

function addRow(in_tbl_name)
var tbody = document.getElementById(in_tbl_name).getElementsByTagName("TBODY")[0];
// create row
var row = document.createElement("TR");

// create table cell 1
var td1 = document.createElement("TD");
//var strHtml1 = "";
var strHtml1 = "

td1.innerHTML = strHtml1.replace(/!count!/g,count);

// create table cell 2
var td2 = document.createElement("TD");
var strHtml2 = "