By default, the form is filled out in a line, but in one. Example: First Name Last Name

Is it possible without CSS?

Code:

<?php if ($config_fields['f_name']['display']){?> <div> <label class="name"> <?php echo _JSHOP_FULL_NAME; ?> <?php if ($config_fields['l_name']['require'].' '.$config_fields['f_name']['require']){?><span>*</span><?php } ?> </label> <span class="input"> <input type="text" name="f_name" id="f_name" value="" class="inputbox" /> </span> </div> <?php } ?> <?php if ($config_fields['l_name']['display']){?> <div> <label class="name"> <?php echo _JSHOP_L_NAME; ?> <?php if ($config_fields['l_name']['require']){?><span>*</span><?php } ?> </label> <span class="input"> <input type="text" name="l_name" id="l_name" value="" class="inputbox" /> </span> </div> <?php } ?> 
  • Well, duck edit the markup, what's the problem? - teran
  • @teran I tried to shove everything in one div, but with php condition I’m kosyachu. through <? php if ($ config_fields ['l_name'] ['display'] and $ config_fields ['f_name'] ['display']) {?> tried, but gives an error - Roman
  • Maybe nobr help? - AIex

1 answer 1

Disassemble the code that I wrote, because if you write php code in html you should use a different spelling scheme, also read about the Brief Code Record , which is appropriate to use in this case. In general, it is not clear what is checked inside the if condition in the name, maybe you missed the logical AND ( && ) between the lines? .

 <div> <?php if ($config_fields['f_name']['display']): ?> <label class="name"> <?= _JSHOP_FULL_NAME . ($config_fields['l_name']['require'].' '.$config_fields['f_name']['require']) ? '<span>*</span>' : '' ?> <input type="text" name="f_name" id="f_name" value="" class="inputbox" /> </label> <?php endif: ?> <?php if ($config_fields['l_name']['display']): ?> <label class="name"> <?= _JSHOP_L_NAME . ($config_fields['l_name']['require']) ? '<span>*</span>' : '' ?> <input type="text" name="f_name" id="l_name" value="" class="inputbox" /> </label> <?php endif: ?> </div> 

  • it seems obvious. that this is the code of the joomla plugin, so that comments on the style of the code can not be presented to the author. - teran