Implementing autocomplete in HTML input - html

I devise a web site. I am using PHP, XML and HTML. There is input forms in my HTML files and I want to implement auto-suggestion in input forms.
When you enter search phrase to google's input form, many suggestions appeared in your browser. I exactly want to implement this.
What must I do? Which language/interface/information I need to?
thanks in advance.

Autocomplete is done via JavaScript. Check out the jQuery Autocomplete plugin for a pretty easily library to get started with. You can either include the values to be used for autocomplete in the JavaScript, or you can make an AJAX request to a PHP script which provides suggestions. Feel free to comment if you'd like more help.

This will be the easiest way to get it done...
http://jqueryui.com/demos/autocomplete/

JQuery UI is a javascript framework that has a nice autocomplete implementation: http://jqueryui.com/demos/autocomplete/
Of course you will need the jquery and jquery ui javascript frameworks.

Related

How to upload a screenshot/image using Wicket

I want user to be able to easily upload screenshots into my application. (preferably without to many js/ajax trickery)
Is there a standard way in Wicket to allow an image to be pasted in some FormComponent (textarea? div with contenteditable?) and used as a regular input, so that when the form is posted, I get a byte[]/stream in the Java code?
You have to use <input type="file"> in the markup and FileUpload component at the Java/server code.
If you need fancier ways than Upload button than you will need to use some Javascript library.
Here is the plain Wicket example
If you use Bootstrap then you may use Wicket-Bootstrap integrations like FileInput or DropZone

How to create a HTML5 tag input

for my HTML5 web application (PHP) I need some input widget for tags like many modern tools have them. For example here a screenshot of Jira label list:
No idea how this widget type is named. I thought maybe it's possible to style with a HTML5 form? Any ideas? I tried to search in goggle, but "tag" and "html" together is a bad search combination. :-)
Hmmm, I just found out by reverse engineering the code of this web page from the tags input below I get some ideas...
But does anyone know an easier example?
enter image description here
You can use jquery autocompleter:
https://jqueryui.com/autocomplete/
And style it whatever you want

how do i pagination works in HTML

i created a site, And added pages to my site, since page size exceeds i need to create pagination in html i have created this method
123
in this way i created
Problem is when i add new page i need to replace all code again like this
1234
ever time when i add new page i need to replace all code is ther a way to do this without PHP
Can sombody help me any idea to do this in html
Do not re-invent the wheel. Use datatables, they provide sorting, pagination (client side and server side), export and a number of additional features.
http://datatables.net/
Include the files and just add this.
$(document).ready(function() {
$('#example').dataTable();
} );
This is a very basic and good example, you should go for it.
http://datatables.net/examples/data_sources/dom.html
This cannot be done purely in HTML. You must use something like PHP, or you could use Javascript.
You can make just one HTML file called "Pagination.html" include all your links there and then include that Pagination on every page using one of the following methods.
You can use Javascript: javascript
Or you can use html5: html5
Or there are also, others solutions to solve your problem like this: other
You better use some Javascript oriented solution, html5 support for including files still very poor.
unfortunately, this won't be possible without using some other technology that is not HTML. You can dynamically generate pages using javascript (JS), PHP or other technology, but not just raw HTML.
You can name your pages something like:
page_1.html
page_2.html
and then whichever editor you are using probably has a search & replace function, so you could use that to speed up things. I hope this helps.

Razor- how to display message box?

I am new to Razor. My application is not MVC.
What I am trying to achieve is to inform user that posting data to database was successful.
I do not want to re-direct user, all I want is to display a good looking message box.
I made quite a lot of research and I found these:
System.Web.HttpContext.Current.Response.Write("<SCRIPT> alert('Hello this is an Alert')</SCRIPT>");
and this
Response.Write("<script>alert('Message');</script>");
They both display message but a very bad looking one.
Question:
How to display a good looking message box using razor syntax?
Thank you!
This is the default browser message box, you can't style it.
If you want a nice looking message you need to style a custom one using html/css/JavaScript.
E.g. you could use a jquery-ui see jquery-ui dialog
You cant.
My preference is ALERTIFY JS

HTML form method with nice URL

I just want to know whether there is a way to answer this question with "Yes" without using JavaScript.
What I want to do is have a search form that automatically generates URLs like http://example.com/search/my+search+term or something similar when I enter my search term into a search text field.
EDIT: Due to some mis-understanding (and not being clear on my part), a clarification: I want the browser to generate that URL based on the value of the text field when the form is submitted.
No, it's not possible without using JavaScript.
The best you can do is using a GET action and have an url like http://example.com/search/?q=my+search+term, where q is the name of the input search box.
Using html only, no.
You could have something server side that might work. You could have the server respond with a 302 response code. If you are using Apache, you could probably use mod_rewrite to take the GET request and generate a new url.
For example, the browser might ask for http://example.com/search/?q=blah+foo+bar, the server could then take that and send the browser a 302 redirect for http://example.com/search/blah+foo+bar.
See more information at the Apache url rewriting guide, or by using your favorite search engine.
You could still use javascript to generate the correct url, but if someone has javascript disabled, this would work as a fallback.
The answer is No
No if you want it to be client side, if you can do it server side (by submitting the form) you can use something like PHP
Yes you could perform something like this server-side pretty easily as long as you don't mind submitting a form.
EDIT: Upon further clarification from the author in comments below: It is not possible in a pure client-side manner without JavaScript or some other client-side tool like Flash/Silverlight (which is admittedly overkill).