Loading...
 
Development

Development


Dynamically adding textbox using Jquery

posts: 6

When I am trying to add textboxes in the tikipages usin Jquery the textbox appears and suddenly vanishes. I want a form in which I have to add fields dynamically. Can any one help me out.. Whether Tiki is blocking such additions?

http://www.mkyong.com/wp-content/uploads/jQuery/jQuery-add-remove-textbox.html

I made use of the code in the above link as given below..

sample.tpl



var headID = document.getElementsByTagName("head")0;
var newScript = document.createElement('script');
newScript.type = 'text/javascript';
newScript.src = 'js/jquery-1.3.2.min.js';
headID.appendChild(newScript);





$("#addrow").click(function () {

if(counter>10){
alert("Only 10 textboxes allow");
return false;
}

var newTextBoxDiv = $(document.createElement('div'))
.attr("id", 'TextBoxDiv2' + counter);

newTextBoxDiv.after().html('Textbox #'+ counter + ' : ' +
'');

newTextBoxDiv.appendTo("#TextBoxesGroup");


counter++;
});

{/jq}
{literal}

counter=2;

{/literal}



Textbox #1 :





Regard
Mohan
excelsisdeo.com


Upcoming Events

No records to display

Menu