Saltar navegación

[Resuelto] Disable the select option in post form

This support ticket is created hace 3 años, 7 meses. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Zona horaria del colaborador: Asia/Hong_Kong (GMT+08:00)

Este tema contiene 1 respuesta, tiene 2 mensajes.

Última actualización por Luo Yang hace 3 años, 7 meses.

Asistido por: Luo Yang.

Autor
Mensajes
#2245321
Screenshot 2021-12-15 at 11.30.35 PM.png

Dear Sir/Madam,

I have a post form with a select element, I want to pass a parameter if the user clicks from a selected link and jumps to this post form.

[php]
[cred_generic_field type='select' field='gf-class']
{
"required":1,
"options":[ [wpv-view name="json-class"] ],
"persist":1,
"default": "[wpv-search-term param="classid"]"
}
[/cred_generic_field]
</cdoe>

How can I disallow the user to change the selected option?

#2245727

Hello,

If you disable the select field "gf-class" of HTML form, it won't pass any parameter to your webserver after user submit the form, and Toolset Forms won't save it's value.

So in your case, I suggest you try to use CSS codes to hide it, for example:

select[name="gf-class"]{
display:none;
}

And you can also display the URL parameter in your post form, like this:
[wpv-search-term param="classid"]