Tags:
create new tag
view all tags

SID-02297: Populating data dynamically in forms

Status: Asked Asked TWiki version: 6.0.1 Perl version:
Category: CategoryForms Server OS: Linux Last update: 7 years ago

Hello,

I am using twiki forms to get user input. My form has select fields. Based on user selection I need to ppopulate data in another dropdown and so on. I tried javascript onChange() to populate new data on selecting an option from list. But not able to populate list run time.

Could someone help by providing sample code to do the same?

Thanks in advance.

-- TWiki Guest - 2017-02-15

Discussion and Answer

Are you saying that javascript you created works but doesn't work when the page first loads?

If so try using <body onload="myFunction()"> to run your javascript function when the page body finishes loading.

-- Jani Hamalainen - 2017-02-20

Thanks. This is now working. But these dynamically populated form fields ( select options) are later not available when a topic is created on submit of this html form. Template is used to create a topic. Could you please suggest?

-- TWiki Guest - 2017-02-20

If what you are trying to do is working in one topic but not in another topic that is based on a template the best thing to do is compare the 'working' topic and the 'non-working' topic. Without seeing the comparison it's hard to point you in a more specific direction but I think the problem will be apparent when you compare.

-- Jani Hamalainen - 2017-02-20

      Change status to:
ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
SupportForm
Status Asked
Title Populating data dynamically in forms
SupportCategory CategoryForms
TWiki version 6.0.1
Server OS Linux
Web server

Perl version

Browser & version

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2017-02-20 - JaniHamalainen
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.