Hi Max,
as in the title:
When a button in CF8 v50 is set to link , it does not take in account the button name, the id and the type.
In previous versions of CF8 that worked ok.
Herebelow the HTML elements copy
Button set to button :
<button class="nui button colored blue iconed" name="pay_ccard" id="pay_ccard" type="button"> <svg class="fasvg icon credit-card" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M64 32C28.7 32 0 60.7 0 96v32H576V96c0-35.3-28.7-64-64-64H64zM576 224H0V416c0 35.3 28.7 64 64 64H512c35.3 0 64-28.7 64-64V224zM112 352h64c8.8 0 16 7.2 16 16s-7.2 16-16 16H112c-8.8 0-16-7.2-16-16s7.2-16 16-16zm112 16c0-8.8 7.2-16 16-16H368c8.8 0 16 7.2 16 16s-7.2 16-16 16H240c-8.8 0-16-7.2-16-16z"></path></svg>Πληρωμή Κάρτα </button>
Button set to link:
<a class="nui button colored blue iconed" href="/index.php/?option=com_chronoforms8&chronoform=cash-desk&chronopage=save_cart_to_sales&payment_mode=ccard&sales_channel=1"><svg class="fasvg icon credit-card" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M64 32C28.7 32 0 60.7 0 96v32H576V96c0-35.3-28.7-64-64-64H64zM576 224H0V416c0 35.3 28.7 64 64 64H512c35.3 0 64-28.7 64-64V224zM112 352h64c8.8 0 16 7.2 16 16s-7.2 16-16 16H112c-8.8 0-16-7.2-16-16s7.2-16 16-16zm112 16c0-8.8 7.2-16 16-16H368c8.8 0 16 7.2 16 16s-7.2 16-16 16H240c-8.8 0-16-7.2-16-16z"></path></svg>Πληρωμή Κάρτα </a>
Could you fix that?
Cheers
Hi simelas
That's correct for the ID, but for other attributes you can just use the HTML Attributes behavior
Yes indeed, but would be easier to have also id to avoid rewriting some forms.
cheers
I have fixed that in the next update! :)
Hi Max,
CF8 V51 still has the issue reported previously: "Button in CF8 V50 lose name id and type when set to link".
Cheers
Happy end of the year celebrations!
a simple modification to overcome the warning due to the lost of button id when button is set to link ( CFV8.0.50 and CFV8.0.51)
Warning: Undefined array key "id" in .../administrator/components/com_chronoforms8/pages/chronoforms/views/field_button/output.php
line 43
}else if($element["btype"] == "link"){$icon = !empty($field["icon"]) ? Chrono::ShowIcon($field["icon"]) : "";$url = isset($element["url"]) ? CF8::parse($element["url"]) : "";
/* *********************************************************** */$field["id"]=$field["name"]; // auto_field_id /* ********************************************************** */
$params = [];if(!empty($element['url_parameters'])){$lines = CF8::multiline($element['url_parameters']);foreach($lines as $line){$params[$line->name] = CF8::parse($line->value);}}echo '<a class="nui button '.$field["class"].'" id="'.$field["id"].'" '.$field["code"].' href="'.Chrono::r(Chrono::addUrlParam($url, $params)).'">'.$icon.$field["label"].'</a>';
line 60
