assign a value to a form field in PHP
Posted: Fri Jun 06, 2014 8:58 pm
I am just starting to use nuBuilder, but I have looked a lot of forum entries and the documentation and tried quite a few things to assign a value to a form field. I don't want to assign the value to the table. I want the save button to do that. I just want to assign a value to a field in a form in the Before Save PHP code area.
From what I can see the most pleasing syntax would be: #field_to_set# = $value; This doesn't work for me.
I tried to exit PHP to use html or JavaScript and reenter php. This didn't scan. So most of the examples I found in JavaScript need to be invoked differently.
I can see that there is a way to store JavaScript code and then use it. But I don't follow how to make it work for me.
Can someone show me the PHP code to assign a value to a form field. I have the value in the variable $newnumber and the name of the form field is powerlevel.
I know this will be simple, but I feel like I'm going in circles and need help.
Thank you.
From what I can see the most pleasing syntax would be: #field_to_set# = $value; This doesn't work for me.
I tried to exit PHP to use html or JavaScript and reenter php. This didn't scan. So most of the examples I found in JavaScript need to be invoked differently.
I can see that there is a way to store JavaScript code and then use it. But I don't follow how to make it work for me.
Can someone show me the PHP code to assign a value to a form field. I have the value in the variable $newnumber and the name of the form field is powerlevel.
I know this will be simple, but I feel like I'm going in circles and need help.
Thank you.