Hello,

I have created a page with the following content:

<p>This line contains a textfield [textfield?name=txt1]. This is the second line</p>
<p>Second paragraph [textfield?name=txt2]. Etc</p>

What I want is to generate a page (using a module) where the text is scanned and all "[textfield]" is changed to an actual textfield. Without labels or other markup stuff.

I have looked at the Forms API, but as far as I have seen, it can't insert fields into existing text. The only possibility seems using the prefix argument, but is there a different way?

Tia,
Newby

Comments

nevets’s picture

Not sure what your goal, while you could write a module that implements such a filter, text fields are not meant to be standalone, but exist inside a form element (without the form element the text fields would do nothing).

onzinnigezooi’s picture

Thanks for your reply. I indeed need a form element.

I want to make it possible for content providers (teachers in this case) to create free-form pages with input fields (using CKEditor). Using keywords with arguments would make it possible to place those textfields anywhere on the page and then save the form values.

nevets’s picture

Well CKeditor actually includes the ability to add forms and form elements if you configure it that way. Problem is the form has no where to submit to.