Solved

how to get caption in the textbox in css or javascript or php

Posted on 2014-12-20
10
50 Views
Last Modified: 2016-04-20
Hi Everyone,
I have attached 3 sample images . i would like to understand how to have caption text in the textbox and when cursor inserted in the text box it vanished.

And a search button inside the textbox itself. you may notice ee also using it .(check the image)
further more if the textbox is not filled up correctly you notice(" ! ")inside the textbox.. (check the images attached )

is that done via css or  html or javascript .or php. need example so i can implement

Thanks
how-to-get-this.jpg
how.jpg
-mark-if-its-not-field-correctly-or-left
0
Comment
Question by:javeedabdul
  • 3
  • 3
  • 2
10 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 40511041
0
 
LVL 25

Expert Comment

by:Kyle Hamilton
ID: 40511258
for search input you have a couple options. you could go with html5, but it only works in modern browsers (ie10+) and the appearance will be dictated by the browser.
<input id="mysearch" type="search" />

or, you write it with css and use a background image of a magnifying glass inside the input.

for the exlamation marks, that's called validation, and you can do it clientside via javascript. if you're using jquery, then the validate plugin is the most ubiquitous. the appearance of erroneous fields (incldung the !) is set via css.

if you. eed a more specific solution, please post a link to your page
0
 
LVL 6

Author Comment

by:javeedabdul
ID: 40511553
Please provide me example or sample code.. in jquery and CSS for 3 issues..

Thanks
0
 
LVL 25

Expert Comment

by:Kyle Hamilton
ID: 40511562
there are plenty of examples on the web. you need to find something that is close to what you want to acheive, create a page or a jsfiddle, and share the link. as the asker of the question it is your responsibility to do the leg work.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 25

Expert Comment

by:Kyle Hamilton
ID: 40511564
at an absolute minimum, you need to provide a page with input fields, and a reference to jquery, as well as the icons you would like to use fir the search field and the error states. jsfiddle.com makes this very easy.
0
 
LVL 6

Author Comment

by:javeedabdul
ID: 40511865
Kyle/Gary thanks

got one issue resolved.
https://mathiasbynens.be/demo/placeholder

search (zoom logo)and its functionality still couldn't work out.
and plus the (!) as mentioned in the pic..

yes i am working on it.. design just finished now i am on the coding side ..
0
 
LVL 58

Expert Comment

by:Gary
ID: 40511874
The zoom image is just a simple image placed after your input box - it's nothing special
And Kyle has already told you about the jquery validations for indicating a field is wrong.
0
 
LVL 6

Author Comment

by:javeedabdul
ID: 40517437
Gary,
I am looking for coding.. thought the zoom is the image thing. i am unable to figure out how to code the background image to work as search query when clicked.

validation is cool too but if i see the code of an existing one or plugin perhaps i can use it on the site

i am unable to post the link as its for personal customer where i am working on design and try to get in coding done.it may take some time to understand once i know how .

appreciate your input
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to install NodejS to run a JavaScript application 3 17
Message not shown 5 34
Sorting a string 1 17
Change CSS to show Notification Bar 9 19
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now