Add Input Field On Click

Add Input Field On Click

Hello all,

I am trying to add this Javascript function to achieve what is on the subject of the message.

"<script language="javascript">

function addInput() {
document.getElementById('extrainput').innerHTML += "<input type='file' value='' /><br />";

I created a container where I set in the Extended Properties id="extrainput" and inside the container I set an expression with extended properties onclick = "addInput();" But sadly this does not work. What am I missing here? Is this the way to add an extra line of inputs when we are editing a Record? Perhaps if we are editing the Costumer in the Template and it lists many industries for that costumer is it possible to add a field (by clicking in a add field) where we can add a new industry?

Hello again,

Check my oml example for your javascript issue. 

I hope that helps
Again Hello,

Thanks Hugo it was really helpfull I understand now a little bit more of what I was missing.

Now another issue. How can I have accesso to the values so I can use what I type to edit a Record? And how would it be If I wanted to place a combo box populated with an entity atribute.

A person has a drivers license and a drivers license can be of different types (cars, motobikes, trailers, etc...)
If I am to edit a Person's driver license I will have all types in a combo box populated from the entity Drivers License Type and two other fields like Date_Issue and Date_Validity.

So I would have:
(Items already existed)
Drivers License of Hugo
type 1: Cars 01-03-2005 01-03-2025
type 2: Motobikes 01-03-2004 01-03-2024

add New Type (link)
(here appears the combobox with all the licenses types + two text input)

Save button which have to retrieve all the values of the field previously created.

I hope I've made myself clear and I am sorry if I am not seeing the big picture.

Thanks once more.


Why you dont use an Web Block to do the trick? When you click  "Add new license" you display the web block with a form, on the save action you need to notify the previous screen (NotifyWidget action from the RichWidgets) to refresh the list that display the types of the Driver.

I hope that helps

Hugo Pinheiro
I did not quite understood what you said but if I use a WebBlock would I be able to add that webblock as many times as I want?
Because I would like to add more than one type of license.

does  (NotifyWidget action from the RichWidgets) allow me to have access to the input field from the Save Action?
Hello again,

See the oml example, I hope that you are clarified now.

Hugo Pinheiro
Dear Hugo,

Thank you so much for your time and concern. That's it!

You gave me a great help understanding better the ServiceStudio.

Thanks once more.

Best Regards.