L
L
Legioner9112015-10-16 10:51:45
JavaScript
Legioner911, 2015-10-16 10:51:45

How to display certain content when receiving a certain value?

onSelect: function(suggestion) {
  console.log(suggestion);
  $('.md-type').text(suggestion.data.type); // возвращает LEGAL или INDIVIDUAL
}


Dear js and jquery gurus, tell me how to display one block when receiving the LEGAL parameter and display another block when receiving INDIVIDUAL. But that they could not be together, that is, either one or the other.

I ask the Lord to help you as specialists.

Sincerely!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim, 2015-10-16
@maxpointn2point

if I understand you correctly, then switch / case

D
Dmitry Kovalsky, 2015-10-16
@dmitryKovalskiy

For example draw 2 blocks and hide them. And the script should be written like
another option - to do the upload by passing the parameter to the server with Ajax. In general, there are not many solutions. Up to if else. This is the first thing that came to mind.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question