Not complete alert

It's definitivly working.

What do you mean with "the radiobutton to be checked"?
The value (to be stored, existing in the formData) is only * IF the radiobutton with this value/label IS checked.
 
It's definitivly working.

What do you mean with "the radiobutton to be checked"?
The value (to be stored, existing in the formData) is only * IF the radiobutton with this value/label IS checked.
The radiobutton to be checked is the answer to the question.
It can be S, N or *
Whether i set it to S,N or * the Yesno remain on its default value of No
In the code i set that if radiobutton=* then yesno should be 1,yes. But when i set the radiobutton to * nothing happen, if i save and reload the yesno remains on no...
You say is correct, and i believe so...so where is the problem, what could i check?
P.s.
Don t know if might help, i use the radiobutton grouped as button
 
Try
Code:
$name = $formModel->formData['lista___artBTN'];
var_dump($name);exit;
if ($name === '*')
{
$formModel->updateFormData('lista___Completo', '1', true);
}
What do you get?
 
Aaaaah i have find the issue!!
The value in radionutton for * had a blankspace before the *!
So was space+*
Now with the code you gave me at first something happen.(the last code returned an error like strings "*")
When i set to * yesno go to yes
But if after that i set the radiobutton to S or N the yesno remain to Yes
 
the last code returned an error like strings "*"
It's a debug message, showing you the type of the variables, the string length, array/object structure etc.
In your case something like
string(2) " *"
 
Ok
Now i have to extend the check to all the radiobuttons
So that if only one of these radiobutton is * then the queationnaire is not complete.
So for me i have to do something like
(I don t declare the variable but use straight away the element name, may be is quicker

if ($formModel->formData['lista___firstBTN'] === '*')
Or
if ($formModel->formData['lista___secondBTN'] === '*')
Or
...
....


{
$formModel->updateFormData('lista___Completo', '1', true);
}
Else
....

IS THE sintax correct?
 
i am trying al lthe possible combination of parehtesis and statement disposal bu ti always get an error..in general not expecting || or not expecting {

$name = $formModel->formData['lista___artBTN'];
$name1 = $formModel->formData['lista___stessoregimeBTN'];

if ($name === '*') || ($name1 === '*')
{
$formModel->updateFormData('lista___Completo', '1', true);
}
else
{
$formModel->updateFormData('lista___Completo', '0', true);
}
 
Last edited:
i can get it to work with the if
elseif..statement
this way it works..but i think this is slower ( and i need to write much more) than the || path
is it?
 
om i am getting closer with the || path
i missed a ; at the end of
($name === '*') || ($name1 === '*')
and i see i don't need the IF
but how do i manage the else then?
with the expression
($name === '*') || ($name1 === '*')...and so on i say
as long as one of this variables = * then follow nect code and lista___Completo =1

but if the
($name === '*') || ($name1 === '*')
is not satisfied..no variables is =* how do i tell to set the yesno to 0?
 
GOT IT!!!!
after tens and tens of possible combination with parenthesis and statemente now it works!
 
As I said: This is NO "learn basics of a programming language" forum. Did you read the links at all?
if (condition) {
code to be executed if condition is true;
} else {
code to be executed if condition is false;
}
Your condition is ($name === '*' || $name1 === '*' || ...)
 
As I said: This is NO "learn basics of a programming language" forum. Did you read the links at all?

Your condition is ($name === '*' || $name1 === '*' || ...)
i find the solution already

just want to ask
it is the same declare all the variables at beginning or use the statement straight in the expresson?
like this
if ($formModel->formData['lista___artBTN'] === '*' || $formModel->formData['lista___stessoregimeBTN'] === '*')

i talk in term of speed..or other thing

and this path is better than the if elseif path?still for speed
 
Last edited:
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top