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

  • Home
  • SEARCH
  • 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 9079243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T19:47:38+00:00 2026-06-16T19:47:38+00:00

I have several input fields and I want it to submit when there is

  • 0

I have several input fields and I want it to submit when there is only one field with entered values and the others are empty (updating user data). I worked by now with isset() but this only sends the form when every field is filledout:

if (isset
   ($_POST['submit']) AND 
   ($_POST['firstname']) AND 
   ($_POST['lastname']) AND 
   ($_POST['address']) AND 
   ($_POST['ZIP']) AND 
   ($_POST['phonenumber']) AND 
   ($_POST['mail']) AND 
   ($_POST['group'])
)

Later on I check in the mail template (another file) if there is a value and wheter to show it in the mail or not:

{if !empty($firstname)}{translate text='First Name'}: {$firstname|escape} {/if}

Is my idea ok or is there an easier way to solve this?

  • 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-06-16T19:47:39+00:00Added an answer on June 16, 2026 at 7:47 pm

    The first if statement is in conflict with your requirements; you are requiring all fields to be filled in by using the AND operation – use OR and it will work with any single field value.

    Validation should/could also be performed on the page itself by using javascript as Matt recommends.

    To ensure that only one field is set do the following you could count the number of entries in _POST

    if(count($_POST) == 1 AND 
       (isset($_POST['submit']) OR 
        isset($_POST['firstname']) OR 
        isset($_POST['lastname']) OR 
        isset($_POST['address']) OR 
        isset($_POST['ZIP']) OR 
        isset($_POST['phonenumber']) OR 
        isset($_POST['mail']) OR 
        isset($_POST['group'])
       ))
    

    Either way it’s not a very elegant way of doing this – but it will work.

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

Sidebar

Related Questions

On my website I have several input fields in a form. I want the
I have webform with several standard fields, however 1 field I want to be
I have a table with several fields and one field having 3 Comma Separated
I have several popups with multiple input fields. I want to highlight the FIRSTinput
I have several datepickers tied to input fields. They are created in the usual
I have... a dynamic populated select box several input boxes a submit button form
I have a page with several Ajax.InPlaceEditor fields. Some are single line (text input
I have a form that includes several input text fields and a list that's
I have a several input fields in a form each having a unique name.
I want to have display-only fields to render data that's never going to be

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.