Usable but invisible input

0

I need an Input, in which I can pass a value to it via javascript but that it is invisible. I have 3 fixed values that I will always pass one of them, SAC, Distributor or Consultant, but as I need to send those values in the form just to know what kind of crud to do in the other file, I would use an invisible input.

I will give an example of the current code, just following the idea of what I use today, the type variable by default is SAC, taking it I add the value of the input as sac ..

<script>
 if(type=sac){
     $('#tipo').value('sac');
 }else if...

</script> 
<form action="page2">
 <input style="display: hidden;" id="tipo">
</form>
    
asked by anonymous 03.07.2018 / 14:31

1 answer

2
<script>
 if(type=sac){
     $('#tipo').value('sac');
 }else if...

</script> 
<form action="page2">

 <input type="hidden" id="tipo"> <!-- Existe o input type "hidden", que é invisível -->
</form>

One more example here: link

    
03.07.2018 / 14:37