Jump to content

Recommended Posts

The names and values of the form fields are all that php receives and when check boxes and radio buttons are not selected/checked, the variable with their name is not even set.

 

Since the form code is yours, you know the names and can write php code that matches.

 

If you are creating dynamically generated form fields, you would need to use field names that indicate what type they were. If you have more than one field of a type, using an array makes it easier to iterate over all the values in php code using a foreach() loop.

 

If this does not answer your question, you would need to provide a specific example of what you are trying to do.

As the previous poster mentioned, PHP doesn't get the type of the input, only the name and the value. If you want to have the type, you will need to provide it to PHP via various methods. One way is to let PHP know with a hidden input text field that tells PHP the type of the field. Another way is to append or prepend the field type to the name, then extract it when you receive it.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.