How to show a hidden field in a drupal form as a pop up after click submit button?

687 views Asked by At

I have a drupal form and I want a make a one field as hidden and when user click on submit button that hidden field should be shown in a popup. Then user should be able to enter some value to that field and submit the form. please help me to do this in drupal. Thanks in advance

1

There are 1 answers

0
Vishal Khialani On

This is what I would do

1) Hide that field using js.

$('#fieldtohide').hide();

2) Have a button on the form which does not submit the form but makes the field visible.

$('#fieldtohide').show();

3) Then show the 'fieldtohide' with the actual submit button.

I don't see the use of drupal forms api for this.This can be done using js.