General developer forum

Modform - Change amount of Input-Fields with GetParam

 
 
Picture of Joseph Rézeau
Re: Modform - Change amount of Input-Fields with GetParam
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developersGroup TestersGroup Translators

Julian "i want to let the creator of the Activity to change the amount of Text Input Fields"

I suppose you mean you want to let the creator change the number of Text input fields (not the amount of text in those fields).

I suggest you look at the way the Quiz settings form deals with adding x Feedback fields to the form. That's file moodle/mod/quiz/mod_form.php. It uses $this->repeat_elements(...).

Joseph

 
Average of ratings:Useful (1)
Picture of Julian Jan.
Re: Modform - Change amount of Input-Fields with GetParam
 

Yes that´s what i meant ( sry im not natively speaking english, hope my english isn´t to hard to read wink ).

Back to the topic, what you suggested really was the way to go reach what i intended to do, thanks for the hint.

I just initialized my optional parameter as standard $repeatno so that if i want to create 21 answers i dont need to click the add 3 more answers button 7 times.

 
Average of ratings: -