Home > Blockchain >  Disable the create button
Disable the create button

Time:12-21

I need to disable the create button when adding a new card. I needed to disable it for the meantime until the user added the data to the field. Any idea? below is my project. Still new to it in web dev.

Thanks!

https://github.com/dueroxette92/web_project_4.git

CodePudding user response:

Try getting the `object.values of the field, and do your onclick function:

if (val !=="") {...}

CodePudding user response:

You can do something like this with javascript for example:

var name_of_place = document.GetElementById('something');
var img_lnk  = document.GetElementById('img-example');
bar btn_create = document.querySelector('btn');

if(name_of_place == "" || img_lnk == ""){
  btn_create.disabled = true
}
else{
 btn_create.disabled = false 
}
  • Related