Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7458509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T13:27:25+00:00 2026-05-29T13:27:25+00:00

I am working with a form, and the front end devs have default text

  • 0

I am working with a form, and the front end devs have default text inside of the textboxes. For instance, the zip code input box does not have a label, however, there is prepopulated text in the boxes. here is an example of an input

<input id="place" name="place" type="text" value="(City, State or Zip Code)"

This particular input is on a search form. This input, along with other inputs, are being passed to the server via ajax. When the results arrive at the server, there is a post variable called “place”, and if unchanged by the user, the value is “(City, State or Zip Code)”. I am wondering if there is a front end solution that I can easily implement to make it so that if the default text is not changed (nothing was entered into the input), the server will see this $_post variable as empty. I already know that I could check on the server and see

if $_post[place] == "(City, State or Zip Code)"
//place is empty, omit it from the search query

but I am looking for a better way, if a better way exists.

How do you deal with default input text?

Thanks!

edit: To summarise, I am looking for a way to pass this and other inputs to the server as blank if they are not changed by the user. I would like to do it without using the aforementioned if $_post[place]…… on the serverside, and if possible, the client side as well.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T13:27:25+00:00Added an answer on May 29, 2026 at 1:27 pm

    You should be using placeholder attribute for that: http://www.w3schools.com/html5/att_input_placeholder.asp

    This will display the placeholder value, but won’t send it to server.
    And let older browsers gracefully degrade to empty input or fallback to JS if you want (how to check if it’s supported: http://davidwalsh.name/html5-placeholder).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the WordPress Login form working in the front-end of my website, to
I have my front end script which has the following jQuery code: $.get(/backend/post.php, {
Form validation for check boxes only seems to be working in IE....? Anyone have
This is the first time I am working for a front-end project that requires
I'm working on an rather small application (C#, winform) that is kind of front-end
I have a project with several layers - among them the web front end
We have a DLL used as the middle layer between our website front end
I am working on the front end of a jsp based app. We're using
I have a working login form. I was just trying to do a simple
Im trying to get a form working in Internet Explorer. I see that when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.