- Я использую PHP для извлечения категорий из таблицы MySQL, и если категория уже существует при редактировании логика записи if/else добавит «выбранное» к тегу опции html по умолчанию для этой категории.
- логика кода любительская – там должен быть лучший способ организовать этот код
Должен быть более красивый способ написания этой логики...
Вот источник представления:
x: is Buildand $row is: Build
Build
x: is Buildand $row is: Idea
x: is Ideaand $row is: Idea
Idea
x: is Buildand $row is: Launch
x: is Ideaand $row is: Launch
x: is Launchand $row is: Launch
Launch
x: is Buildand $row is: Grow
x: is Ideaand $row is: Grow
x: is Launchand $row is: Grow
x: is Growand $row is: Grow
Grow
x: is Buildand $row is: Review
x: is Ideaand $row is: Review
x: is Launchand $row is: Review
x: is Growand $row is: Review
x: is Reviewand $row is: Review
Review
x: is Buildand $row is: Wiki
x: is Ideaand $row is: Wiki
x: is Launchand $row is: Wiki
x: is Growand $row is: Wiki
x: is Reviewand $row is: Wiki
x: is Wikiand $row is: Wiki
Wiki
x: is Buildand $row is: Engage
x: is Ideaand $row is: Engage
x: is Launchand $row is: Engage
x: is Growand $row is: Engage
x: is Reviewand $row is: Engage
x: is Wikiand $row is: Engage
x: is Engageand $row is: Engage
Engage
x: is Buildand $row is: Market
x: is Ideaand $row is: Market
x: is Launchand $row is: Market
x: is Growand $row is: Market
x: is Reviewand $row is: Market
x: is Wikiand $row is: Market
x: is Engageand $row is: Market
x: is Marketand $row is: Market
Market
x: is Buildand $row is: Shopping
x: is Ideaand $row is: Shopping
x: is Launchand $row is: Shopping
x: is Growand $row is: Shopping
x: is Reviewand $row is: Shopping
x: is Wikiand $row is: Shopping
x: is Engageand $row is: Shopping
x: is Marketand $row is: Shopping
x: is Shoppingand $row is: Shopping
Shopping
For this particular record, the category is "Grow" - so the dropdown should default select to Grow, but it doesnt.. no errors are thrown
Подробнее здесь: https://stackoverflow.com/questions/792 ... cted-via-m
Мобильная версия