Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic form behavior not working properly with javascript alert in yii2 #322

Open
IntegrityFoundation opened this issue Jan 10, 2022 · 0 comments

Comments

@IntegrityFoundation
Copy link

IntegrityFoundation commented Jan 10, 2022

I am using Yii2 basic application template. I am using this widget. But In my controller update action I am checking a condition when that condition is executed I am displaying an alert message box in javascript as well as returning the form with model. But after the alert box is displayed the dynamic form columns names appear to big or larger in size as well as the + and - buttons to add and remove the items also appear differently as shown in figure. But when I remove those lines which contains the alert box then it is working fine. How to resolve this?

if($count>0 && ($model->FormationDate!=$dateofformation||$model->JoiningDateWithIF!=$joiningdatewithif))
					{
						ob_start();
						echo "<script language='javascript'>";
						echo "alert('You cant update the Formation Date or Joining Date With IF because group saving details 
                                                            exists for this group')";
						echo "</script>";

						return $this->render('update', [
                'model' => $model,
				'modelsmember' => (empty($modelsmember)) ? [new Memberdetails] : $modelsmember,
            ]);
						ob_stop();

					}

image

image1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant