Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
function remove doesn't work, please help...
Old 10-31-2010, 03:15 AM function remove doesn't work, please help...
Average Talker

Posts: 24
Trades: 0
Hi, If someone here is willing to help me I would really appreciate
the function removeInput() of javascript at below not work properly, what i should do?
Quote:
<script language="javascript">
fields = 0;
function addInput() {
if (fields != 10) {
var htmlText = "<input type='text' name='addfriends[]' value='' size='auto' maxlength='45' /><br />";
var newElement = document.createElement('div');
newElement.id = 'addfriend';
newElement.innerHTML = htmlText;

var fieldsArea = document.getElementById('addfriend');
fieldsArea.appendChild(newElement);

fields += 1;
} else {
alert("Only 10 friends allowed.");
document.form.add.disabled=true;
}
}
//field = 0;
function removeInput() {
var div = document.getElementById('addfriend');
var lastElement = document.removeElement('div');
lastElement.id = 'addfriend';
if (lastElement > 2) div.Element(lastElement - 1);

}
</script>
Thanks a lots
jones is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to function remove doesn't work, please help...
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.20987 seconds with 12 queries