You can set a value directly (e.g. value="10"), or using another shortcode. (The context for that shortcode would be the page where the Form is inserted.)
i will explain better:
I am displaying an update form inside a post view.
I would like to pre-populate form fields with some variables i has in this view.
so i need to pass terms by the [cred_form form="add-cause-id-in-tehilim-post" terms????]
is it possible?
Sorry, now i understand what you meant...
So the terms of my views (shortcodes) works well and are populated in the form.
But still i have a problem:
I have a repetitive field wich i want to add a new value to it and not just change its value .
How to do it?
This is a form to edit a post and it includes some existing values for repeating fields and you want the form to automatically add some new instances of the repeating field?
I can't see how you would do that, but let me confirm that is what you want first.
I thought we were talking about adding another repeating field instance when the form is loaded, but you mean add another instance after the form is submitted?
Where would the value of the new repeating field instance come from?
Let's make a concrete example that I could practically develop.
Say that the post type the form is editing has a simple single line text field "name".
The post being edited already has several instances of the name field, e.g. John, David, Elisabeth, and Joel.
When we click the button to be redirected to the edit form, the form loads and as well as the existing four names, we want to automatically add "Paul".
Questions:
- what page is the edit form button on (is it the post itself that is going to be edited, or something else)?
- how should the form know that the name to be added is Paul?
- is this visible to the user? Does it matter that if the name Paul is smuggled into the form invisibly, but is only added to the edited post once the form is submitted?
"- what page is the edit form button on (is it the post itself that is going to be edited, or something else)?"
answer - right now it is in the post itself - or in a post view of the post.
- how should the form know that the name to be added is Paul?
answer = by an attribute in the form shortcode
- is this visible to the user? Does it matter that if the name Paul is smuggled into the form invisibly, but is only added to the edited post once the form is submitted?
answer - no it is not visible to the user - only the submit button will be visibel.
I've been playing around with this, and I can't see a way to pass a value to a form.
Once the form has the value, everything else is reasonably straight forward, but I can't see how to get the value to the form.
Let me ask again in my hypothetical example, how should the form know that the name to be added is Paul?
You say "by an attribute in the form shortcode". Putting to one side that the form shortcode accepts no such shortcode, even if it did, how would you set the value of the attribute? Where does the value come from?
Shalom
I needed this capability for a site that i am doing - but in a parallel ticket you gave me a new idea about how to bulid the data base and the relationships , in a way that right now i can go on without passing an atribbute by forms.
I think anyway it shoul be a good idea for next releases.
Thanks by now - i 'll continue in the other ticket in contact