0

Hi there,
I solve a problem with append the values into the value atribute of input.
If I click on some html element, I need this text of element put into the input as its value. The problem is that I don't know, how to put several values into the input.

I try it to solve so:

$("a.knowledge").live('click', function() {	
  val = $(this).html();
  $("div.new-pol2").append(val);
  $("input#frmfirstForm-specializace").append(val(val+';;'));
  $(this).remove();
});

I want the values puts into the input#frmfirstForm-specializace (the values are separated by ';;') -- but always I've in this input only one value, never several, on which a clicked... and I don't know, how to put in that input several values...

I will be very glad for every help, idea. Thanks.
Manny

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by Airshow
0

To me, this doesn't look like you are appending value to the existing value but rather attempting to append the same attribute to the input tag... I don't use JQuery, so I am not sure the right way to fix this. If it is pure JavaScript, I could.

0

Manny,

I think you might want $("input#frmfirstForm-specializace").val($("input#frmfirstForm-specializace").val()+';;'+val)); .

It's a bit long-winded but give it a try.

Airshow

Edited by Airshow: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.