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 7658019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:08:49+00:00 2026-05-31T13:08:49+00:00

I have 3 sets of 4 input fields that I want the user to

  • 0

I have 3 sets of 4 input fields that I want the user to complete and submit to my site. Fields are optional.
I have an $all variable that I am storing the data inside.

However, if any input fields aren’t completed, then I’d like to remove the placeholder text from the $all variable.

Currently my output (var_dump) for completing the first row is:

string '1|1|1|1

Height (cm)|Width (cm)|Length (cm)|Weight (kg)

Height (cm)|Width (cm)|Length (cm)|

' (length=133)

However, I’d like it to be:

string '1|1|1|1' (length=7)

Here is my current code on Pastebin: http://pastebin.com/2Je75vN0

As you can see, placeholder text is placed inside the field using javascript and the title attribute.

Can a very nice and gifted person please point me in the right direction with this? Or should I perhaps be using Javascript to validate this?

Many thanks for any pointers.

  • 1 1 Answer
  • 4 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-31T13:08:49+00:00Added an answer on May 31, 2026 at 1:08 pm

    Consider using HTML5’s placeholder= attribute (with a JavaScript fallback for older browser).

    It’s inefficient and it doesn’t make sense to handle placeholders on the server side.

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

Sidebar

Related Questions

I have a dynamic form that users can add/delete sets of input fields. I
I have a form that sets input fields as enabled / disabled based on
I'm working with Jquery in Drupal. I have sets of four blocks that all
I have 2 sets of 4 input fields in my HTML Form. I expect
I have two sets of of input fields like this, differentiated by their classes:
I have two input fields. The main idea is that whenever you focus to
I have a button that when clicked sets the text in an input text
I have a number of sets of input fields on page, like this: <div
I have a function that sets text input's to whenever they are clicked/focused on.
I have four input fields: MaxWidth MaxHeight and Width Height I want to validate

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.