The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Form entry update from history.
Urban
post Dec 6 2010, 03:20 PM
Post #1


Newbie
*

Group: Members
Posts: 16
Joined: 13-November 10
Member No.: 13,134



Hi,

is there any way by which i can update my form entry, by highlighting over the history, something like how Google does...like when u start typing 'jav' ull have suggestions such as Java and as u scroll down to that option, ur form entry keeps getting updated to the suggestion that u are highlighting upon...

I wanted to achieve this, but obviously without the suggestions and instead history... I hope ur able to understand what im trying to ask.

Thx smile.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Dec 7 2010, 01:49 AM
Post #2


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,351
Joined: 9-August 06
Member No.: 6



Your own history of what you have previously entered? That's browser specific... For IE at least it's based on the name of the form control. If you view the below in IE you can see your old google seaches and a fair lot of other form entries probably.

CODE
<form action="">
<input name="q">
</form>

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Urban
post Dec 7 2010, 02:20 AM
Post #3


Newbie
*

Group: Members
Posts: 16
Joined: 13-November 10
Member No.: 13,134



yea..the problem isnt that i cant see my form history. I can...but what i was tryimg to do that if i am typing sumthing into the field...i can see the history below..so now i use the arrow keys to go down to the history element that i want to use again..and as i scroll down to that entry, my form takes in the current value highlighted, so that i changes its value depending on where my highlight is.
As in google, when u type sumthing and u find ur query in the suggestion...if u take ur focus down to the suggestion that u want using the arrow keys, then ur form value takes in the value that u have focussed on, without pressing enter or anything like that....

it isnt a very big problem or anything...but i really want to know how can u make that happen...
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post Dec 7 2010, 02:54 AM
Post #4


Programming Fanatic
********

Group: Members
Posts: 5,146
Joined: 23-August 06
From: Europe
Member No.: 9



I think you're after "auto suggest" or "auto complete". There are many scripts (using javascript and/or JSON, XML, AJAX, PHP) for that on the web. Though probably most will use a click or the Enter key.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Urban
post Dec 7 2010, 04:29 AM
Post #5


Newbie
*

Group: Members
Posts: 16
Joined: 13-November 10
Member No.: 13,134



k..i guess im not able to explain the problem correctly..
I DO get history suggestions when i start typing in the form field...and it DOES fill the form with the history value on pressing enter...but i was trying to get my form filled dynamically as i go to my history...

Im attaching some screenshots from google so that u r able to understand what i wanted to achieve..
Attached Image
Attached Image
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post Dec 8 2010, 03:05 AM
Post #6


Programming Fanatic
********

Group: Members
Posts: 5,146
Joined: 23-August 06
From: Europe
Member No.: 9



I did understand what you are looking for, it only takes time to do a good search. Take a look here:

http://scribe.googlelabs.com/
http://scribe.googlelabs.com/static/help.html

You also might find plugins for JQuery ( http://plugins.jquery.com/ ) that do similar things.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Urban
post Dec 8 2010, 09:39 AM
Post #7


Newbie
*

Group: Members
Posts: 16
Joined: 13-November 10
Member No.: 13,134



@Frederiek thx a lot for those...but thats still not what i was asking for... I was using google just to show an example.
Basically..i dont want google to suggest..i want my history to be used instead.
At the present moment i can use my history to fill form, but what is happening is that i have to scroll down to my form history that i want to reuse, and i have to press enter.
what i want is that i scroll down to my history element to be used, and as my highlight goes over it, my form takes in the value, without me having to press enter, or anything.
Google does this with its suggestions, as u find ur suggestion while u hadnt completed typing, if u just go down to the suggestion, the form gets the value that u have focussed upon....u dont have to even press enter.
Thx a lot for ur reply...but i really wish ur able to find the solution now.. smile.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post Dec 8 2010, 11:11 AM
Post #8


Programming Fanatic
********

Group: Members
Posts: 5,146
Joined: 23-August 06
From: Europe
Member No.: 9



Google uses an algorithm to offer searches that might be similar to the one you're typing.
Anyway, like I said: do your own search on the web for "autocomplete" and pick the script that suits your needs, eg. one of the first results returned : http://jqueryui.com/demos/autocomplete/ using JQuery.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Urban
post Dec 8 2010, 01:25 PM
Post #9


Newbie
*

Group: Members
Posts: 16
Joined: 13-November 10
Member No.: 13,134



k..i want exactly that...but i dont need 'suggestion', instead, just history will work. The forms that one creates, automatically shows history, without need any script...so is there anyway i can get that functionality, without using suggestion, and instead using history ?.

Basically, that would mean, i want the form to display history as i type, and when i highlight the desired history entry, my form gets the value....so any way to do that?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Dec 8 2010, 01:37 PM
Post #10


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,351
Joined: 9-August 06
Member No.: 6



I think you'll find this quite difficult, probably impossible. To fill the input with a value from the browser history, you need to know that value. JavaScript isn't allowed to read the browser history. It can do some tricks with it, like history.back() and so on, but it never has access to the URLs stored in the history.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Urban
post Dec 8 2010, 01:50 PM
Post #11


Newbie
*

Group: Members
Posts: 16
Joined: 13-November 10
Member No.: 13,134



no..thats not what im asking.. sad.gif

ok..ill expplain very very slowly..plz bear with me...

I make a normal html form field, that im using as a search bar..for google and wikipedia.
Like every other text field, whatever ive searched on that particular (my own made) search bar, it shows me the history of other things that ive searched for previously.
Whenever im saying history, im not actually asking for browser history, im talking abt this particular form field's history.
So now i want to search for html help forum. As i begin to type this into the custom made search bar ( another normal html form field) i notice that ive already searched for this earlier. And so, the form history displays " html help forum" in the small popup window that usually appears under every other search bar, showing my history.
Now this is what I see: I see that my html help forum is 4th on the history popup list, and before that i have html, html5, html help, and then i have html help forum. Got it till here?

Now i use my arrow keys to go down on the list to html help forum, but as i go down using the arrow keys, i first reach html. As my highlight reached html, my form automatically took the value html.
Next i press the down button again, and i go down to html5. My form automatically took the value html5 (without me having to press enter).
Next i go down to html help, again form shows html help, and finally i reached html help forum, and my form now has value html help forum.

Note that im neither using google's keywords, nor am i asking the browser for my history. Im just using the history that the form has.
As of right now, my form does show history (like normal) and i can go down to html help forum, but i have to press enter, just to get my form take that value, and then press enter again, to begin search.

I know what im trying to do isnt a very big deal...after all i can press enter and get the work done, but i just wanted to know how do other sites achieve this.

I really hope i was able to tell u ppl what the problem is. I wish a solution is found smile.gif
sry for the long post..
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Dec 8 2010, 03:19 PM
Post #12


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,351
Joined: 9-August 06
Member No.: 6



Duh, I confused things. I still think what I said is true. I don't think JavaScript can access the autocomplete history either. If it could it would be an even bigger security (or rather privacy) risk than the browser history.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post Dec 9 2010, 02:45 AM
Post #13


Programming Fanatic
********

Group: Members
Posts: 5,146
Joined: 23-August 06
From: Europe
Member No.: 9



The script I pointed you to uses a pre-populated list of values. In your case, you will need to store the words everytime they are searched for instead (in a text file or a database), and have the script loop through each line or entry to retrieve and filter any words that match.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th August 2019 - 10:07 PM