Input within DIV with visibility:Hidden

Asked

Viewed 99 times

2

Guys, here’s the deal, I hid some div,that have inputs from a form inside, with

style='visibility:hidden; position:absolute'

And I’d like these DIV did not send information when the form was forwarded.

My question is: Is there only way to do this using JS or is there a simpler and less manual way to do this?

  • The most you can do is group inputs using a fieldset instead of a div and mark this fieldset with the Property disabled, unfortunately this approach does not work in IE.

  • @Tobymosque just tested it and it doesn’t really work in IE

1 answer

1

to hide fields from a form use

<input type="hidden" name="NomeDoInput">

Instead of doing this via CSS. if you do not want the data of a form not to be sent to another page using form, leave these inputs out of the form or if you prefer to use:

unset($_POST['nomeDoCampo']); //Com PHP

where such data have already been sent.

  • +1 I agree that the best way not to send inputs with the form is to leave them out of it.

  • His page can be made in ASP.NET Webforms with Form1 in Masterpage, the visibility of the div can be controlled by some script, in addition to other factors that may make it impossible to put inputs out of the form. In any case, this answer does not answer the question, "how to prevent the sending of an input through some markup on a Parent".

  • The question is just what @Tobymosque said. It is being controlled by a script, there is a need to leave inputs inside the form.

  • Please specify the language you are using, let HTML and CSS open many possible options using several other languages.

  • @Rafaelacioly I changed there, to using php + javascript.

  • when the parameter is passed by the form to the other page try unset($_POST['yourCampo']) so that it ceases to "exist", already tried this?

  • I am currently using this solution, but I am looking to find a less manual way, like this.

Show 2 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.