How to retrieve id's and names of all fields of a particular type from html to Django views - html

I have a html form with a list of input fields with id's, names and values. Is there a way I can get these values in Django views by only mentioning the input type. For example : get the id's and values of all input elements with type text.

Related

field in semantic mediawiki with options where label and value are different

How can I have a select field (e.g. combobox, tokens) with options where label and value are different in semantic media wiki?
I tried "Allows value list" with json. The list works but somehow I can't use it as datasource for a field.
A mapping template could work but is hard to maintain because the syntax of the template is very confusing for users compared to json and the values are stored in two pages (form and mapping template)

How do I use function field's 'glidefunction:concat' correctly in servicenow?

I have created a new field in servicenow called QI (u_qi). I want to populate this field with three other fields in other words concatenate them.
My problem is, that the field is not showing up correctly. Instead of getting names, I get random chains of numbers and letters.
Here is the configuration:
And here is what I mean by random numbers and letter:
The only field showing up correctly is the number field.
Those aren't random numbers. The number field returns the CHGxxxxxx number and the other long strings are sys_id values that reference users. You need to call getDisplayValue to get a meaningful value:
glidefunction:concat(number,',',requested_by.getDisplayValue(),',',assigned_to.getDisplayValue())

Multiple Values in one "SMW Page Forms" field

I ran into a problem with Semantic Mediawiki using the Page Forms extension.
I wanted to create a field in a Page Form, that can take more than one value. So I decided to use the tokens input type.
The problem is the following: If I type some values into the form field and save the page, Page Form puts all the values - seperated with commas - into one single SMW value.
For example: I have a form that will create a page about a scientific paper. And in this form I have a field that is called Authors. And when I fill the field with two Authors, lets say Pascal and Tesla, then the final page does not have the two SMW values [[Author::Pascal]] and [[Author::Tesla]] - It has the SMW value [[Author::Pascal, Tesla]].
Does anyone know, how I can achieve the mapping from different values in the form field to different values as SMW strings?
Thanks and greets,
J
Multiple values for the same field covers this.
Put the following in your corresponding template:
{{#arraymap:{{{Author|}}}|,|x|[[Author::x]]}}

Howcan I change the visible name of a many2many field?

I am using Odoo8.
I have two models: x_items and project.task.work.
I have a field called name and a custom field called x_wo_ref in the project.task.work.
I have a many2many field x_item_wo in the model x_items which is related with the model project.task.work.
Currently when I fill the field x_item_wo, the field name from project.task.work is showed.
How can I customise it in order to use the field x_wo_ref instead of the default field name for this many2many field?
Thank you
You need to define the _rec_name attribute of the model. _rec_name takes as default the field name and if this does not exist it does not take anything unless you specify it. For instance if you need to see the field phone you must write:
_rec_name = 'phone'
In case you want a _rec_name depending on anything you need to change the function name_get(). You can see examples in other models.

How to POST multiple values on form submit?

Im building a survey.
A question is built up as a matrix, where there are rows and columns.
You can see an illustration below:
When i submit the form, i have to save the answers for every row.
Question 1 and 2 are easy enough. All i need to know is the ID of the row, and the ID of the column, in order to save the answer. I can use the "name" attribute to save the row ID, and the "id" attribute to save the column id. This will get sent back with the POST method.
However, question #3 has one extra field, which i also need to send back, besides column ID and row ID (the text input value).
What is the best way to do this?
I think you can post 4 values to the server, the column id, row id, value and the type so that if the type is radio button or checkbox the server will ignore the val field and if the type is textbox, the server will get the value from the value field. Does that help you ?!
Just name all of it with the HTML name function then make the same base setup on mysqli and set the same pos's and markup everything with php...