last day (34 days later) » 

1:14 PM
0
Q: How to re-select value from JSON

blueinkI have Ajax live search script it has few text input can search products. The live search function works great. and I have a question: If I would like to change one of product name How to go back before page and re-select the product? I tyred re-select diffrent one but it still same prod...

 
If the JSON source is the same always I would recomend that you load it only once and save it as an object, that way you don't execute the same call on every keyUp event, if you can provide a fiddle with your code I could help you with that
 
Dear @Sabbin Thank you for helping me. Yes. JSON is always same. I'm very beiginer so I don't know what to fix it about KeyUp. I will add 2nd search section thatI just combined that is so garrulous I guess haha.
 
if you can create a fiddle here - jsfiddle.net - with the HTML code and the full jQuery code, I can help you organize the jQuery part and the logic for the search
 
Dear @Sabbin Thank you so much ! jsfiddle I never used it before it works good ? jsfiddle.net/blueink/7kmjh6cd/4 and I wonder how can I put JSON code ?
Dear @Sabbin I add JSON file here. I'm so happy you doig so nice to me
 
I'll resolve your fiddle and come back with a response
 
1:14 PM
Dear @Sabbin Thank you so much!!! I'm tesing right now Could you wait for me a while .
Dear @Sabbin WOW this is amazing!! it become way faster! THANK YOU SO MUCH!!!
 
Please check the response, it should help you get the data from the file
 
Dear @Sabbin Thank you very much at yesterday. I tried my main pc. about your first code that really fast item show up but it can only re-select 2nd live search. 1st live search is same. So then I tryed your final code you posted jsfiddl. i used whole js code but i didnt work even live search function. I tryed to chage little bit for work but I just couldn't becase of my poor understand ...Actually I have 3 live search text area. I won't make it for Three so could you teach me again please. 3rd text inut is all same without name="search3" id="search3 .
 
Hi
Chat is a simpler way to discuss this
First you are applying a bad logic to your JS code
 
Hi. thank you for you are very kind person!
 
I'll create a simple fiddle just to understand what's happening
 
1:16 PM
I really glad your warm heart
yes
 
1:32 PM
You are ceating fiddle right? Please take your time . chat is my first time at here so.
 
can you see the fiddle?
 
Yes! I opene your url
 
Ok, so now you have only one input
 
yes
 
First of all, the handlers bindings are not done in the document ready
 
1:41 PM
yes
 
in the document ready you only load your JSON
the rest of the bindings are done outside the JSON function
document.ready sorry
 
yes
 
now, what do you want to do with the results?
when you click on one item
 
i would like to display "name"
 
only to display the names on all 3 selects?
 
1:43 PM
yes
here is my goal
costomer only show NAME value
 
so you need 2 more selects only?
 
and "code" and "location" are for our information so visiter dont need it
when visiter type somehting and NAME show up then click next page buttom
Vister can see only NAME value but WE would like to the name's code and location
so Display name is only name is good enogh
other selection is same
like selecting produt at shopping.
visiter select product name 1, and 2, and 3.
but visiter might misselect the product so in case of this I would like to go back before page and re-select the product.
sorry my expling is not good
am i ansering correcty?
I would like leat 10 selection.
I said 3 before. sorry it's 20
if I have 20 selection is very good enough
 
I'll update the fiddle and come back when it's done
 
Thank you so much!! you are superman!!! my hero!!!
 
2:22 PM
is this your desired result?
you can change the field numbers in the document ready function
 
AMAZING!!!!
very clean! and very styleish!!!
I have a question
 
say
 
when I type another text box. can I get a name2 or name3 value right?
type some word at like text box 2 or 3 .
as a value name2 or name3
 
you can get the values via jQuery for each field
 
Wow !!! cool!!!
 
2:30 PM
$(.search[data-ref="${NUMBER}").val();
 
Could I try this code at my laravel local server?
Wow! super !!!
 
where NUMBER is the reference for the input field
 
Could you wait for me please I will be back soon.
 
1,2,3
 
WOW!!!
 
2:33 PM
I will write another answer, with the full solution
I would ask you to upvote both my answers and accept the full one
 
THANK YOU!!! sorry I'm talking long right now becase some how container didn't show up but that's okay I will figure out. Yesh I will UPVOTE .
 
Thank you as well, just don't forget to change the path for the JSON in the getJson() function
now it's loading from online, put your local path there
 
I understand Thank you.
Do me a favoer? I'm having little prolbem... you made really clean code. and I never used id container. some how text box didnt show up I think id container part. Do you know what my problem is ??? I add css too...
i tryed laravel and my xampp server both . but both container didnt show up
 
have you put the <div id="container"></div> in the page?
put your full html template in a fiddle
 
sorry really messy code
i put <div id="container"></div> line 60
 
2:50 PM
i added the JS code there
and it works
 
sorry still text box didnt show up...
should i put heaer file too?
the file is appjson.blade.php
I've been tryed your code at laravel and xampp but still same. You must be very tired I guess so you can do this tomorrow if you like .
 
are you loading the Javascript in your template?
 
3:07 PM
yes... i comment out all my old code and past your whole code so ... js file are same
Could you see this code this is my xampp jsfiddle.net/blueink/L1jaxb72
I use just one file and JSON data locate same folder
 
i'll look into it
 
Please don't rush . Please take you time.
I really appreciate.
Dear Sabbin. I'm afraid to say this sorry I have to go now. so Is that okay to talk tomorrow?
Sorry I will go now . Thank you for helping me alot! See you tomorrow!
 
3:27 PM
I will post here the result fiddle
 
Thank you ! I will see you tomorrow !
Today was so fun time Thank you!
 

  last day (34 days later) »