jquery livequery not fixing autosuggest? -


I have an automatic suggestion feature enabled in the search products section of the Order Item section:

Here's the problem, when I add new search product areas (green button under order item title), auto suggest plugin is not working in new areas. I read some articles, I thought automatic suggestions would fix this problem, but not fixing. Any ideas why?

Auto-suggestions:

  $ ("# PRODUCTNAME"). Autocomplete ("orders.cs.asp? Process = list product", {select first: incorrect}); $ ("# PRODUCTNAME") Results (Tasks (Events, Data, Formatted) {if (Data) $ ("# PRICE"). Html (Data [1]); $ ("# ID") .HTML [2]); $ ("# UNITPRICE") Html (data [1]); $ ("# PRODUCTID") Html (data [2]);});  

Adding new fields

  $ ('# addProduct'). Livequery ('click', function (event) {$ ('# OrderProducts') .append (' & lt; div class = "column width 50">  input type = "hidden" id = "PRODUCTID" name = "PRODUCTID" /> gt; input type = "hidden" id = "UNITPRICE" name = " UNITPRICE "/> gt; & gt; Small & gt; Find Product Type =" "Square =" Width 98 "/" Gt; & lt; Small & gt; Volume & lt; / small & gt; & lt; / Div> div class = "column width 30">  entity price: 
total value

html & lt; / span & gt; & lt; / div & gt; '); Back

})

fieldset & gt; & lt; h2 & gt; order item & lt; / h2 & Lt; div id = "orderProducts"> ; & Lt; / a & gt; & lt; a href = "#" id = "DeleteProduct" & gt; & Lt; Img src = "icons / cancel.png" alt = "cancel" /> & Lt; / A & gt; & Lt; / Div & gt; & Lt; Input type = "hidden" id = "PRODUCTID" name = "PRODUCTID" /> & Lt; Input type = "hidden" id = "UNITPRICE" name = "UNITPRICE" /> & Lt; Small & gt; Search Products & lt; / Small> & Lt; / Div & gt; & Lt; Div square = "column width 20" & gt; & Lt; Input type = "text" id = "UNITPRICE" name = "UNITPRICE" value = "" class = "width98" /> & Lt; Small & gt; Quantity & lt; / Small & gt; & Lt; / Div & gt; & Lt; Div square = "width width 30" & gt; & Lt; Span class = "prices" & gt; Unit Price: & lt; Br / & gt; Total value: & lt; / Span & gt; & Lt; / Div & gt; & Lt; / Fieldset & gt; });

I think the problem is that you do not have autocomplete for the new element Add. You do not really need livequery, so changing the second block of code like this:

  $ ('# addProduct'). Click (function () {var add = $ ('& lt; div class = "column width 50" & Input type = "text" id = "PRODUCTNAME" name = "PRODUCTNAME" value = "" class = " Width 9 "input type =" hidden "id =" PRODUCTID "name =" PRODUCTID "/ & gt; & lt; input type =" hidden "id =" UNITPRICE "name =" UNITPRICE "/> Gt; & gt; Small & gt; Search Products & lt; / small & gt; & lt; / div & gt; & lt; div class = "column width 20" & gt; div type = "text" Id = "UNITPRICE" name = "UNITPRICE" value = "" class = "width98" /> gt; Small & gt; Volume & lt; / small & gt; & lt; div & gt; & lt; div class = column Width 30 "& gt; span category =" prices "& gt; Knit Price: 
Total Value: '); $ (' # Order Products') Results (Functions (Events, Data, Formatted) {if (data) {} (data) {} {autocomplete} ("order.cs.asp? Process = list generator", {selectFirst: false}). Adding.find ("#. Value") val ( Data [1]); adding.find ("# ID") Val (data [2]). Adding.find ("# UNITPRICE") Val (data [1]); Adding.find ("# productId") Val (data [2]). }}); return false; });

I think it should do, except for one or two small tweaks here and there.

How are you handling your form elements on the way, just two comments - your method results in more than one element with the same ID, which is invalid (although this will work) - Perhaps instead the classes To select it on the basis of it will have to change. Secondly, you have used the HTML function to set the value of the input - it is also not sure if it works, so in my proposed solution I changed the HTML calls with Val.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -