0

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

mzy
  • 1,754
  • 2
  • 20
  • 36
Rohitha
  • 145
  • 1
  • 11

1 Answers1

2

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.

Vishal Khialani
  • 2,557
  • 6
  • 38
  • 49