Issues with Chrome and Safari but not Firefox
See original GitHub issueI have this code that works as expected in Firefox. A user uses a dropdown and the results populate subsequent text inputs. For example the s-val:desc fills in the text input desc that follows. In Chrome and Safari it does not work. Changing the dropdown does not populate and since they are required, the form fails.
<div class="col-2">
<div id="sel" s-preserve="true">
{% set cpt_options = craft.entries.section('cptCodes2').all() %}
<select class="form-select">
<option value="">
Code
</option>
{% for option in cpt_options %}
<option sprig s-val:cpt="{{ option.code }}" s-val:desc="{{ option.description }}" s-val:price="{{ option.number_price }}" {{ option.id == cpt ? ' selected' }}>
{{ option.title~' : '~option.description }}
</option>
{% endfor %}
</select>
</div>
</div>
<div class="col-4">
{{ input('text', 'fields[description]', desc, {
class: 'form-control',
required: true
}) }}
</div>
<div class="col-2">
<div class="input-group mb-3">
<span class="input-group-text">$</span>
{{ input('text', 'fields[billed]', price, {
class: 'form-control',
required: true
}) }}
</div>
</div>
Issue Analytics
- State:
- Created a year ago
- Comments:9
Top Results From Across the Web
Firefox can't load websites but other browsers can
This article describes problems where Firefox cannot load websites but other Web browsers (such as Microsoft Edge or Internet ExplorerSafariEpiphany on ...
Read more >If Safari on Mac doesn't open a webpage or isn't working as ...
If Safari isn't working as you expect, one of these solutions might help. These solutions are for issues that affect Safari on Mac,...
Read more >Why can I browse with Firefox but not with Safari or Chrome?
Today I find myself able to browse with Firefox but not with Chrome or Safari. A select few pages are still working but...
Read more >Website loads fine on Firefox, IE, Safari but not on Chrome
Website loads fine on Firefox, IE, Safari but not on Chrome · Disabling chrome extensions · Deleted cache on both devices · Reinstalled...
Read more >How To Fix Web Browser Audio (Chrome, Safari, Firefox, Etc.)
Select the appropriate output device from the list. If the device(s) (microphone, headphones, speakers, audio interface, etc.) are not available, try ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mattstein unfortunately that’s not it.
As @bencroker said,
s-val
won’t work onoption
values. It’s weird that it works in Firefox, though. And as @mattstein said, you might need to add thename
attribute to your<select>
, as well as thesprig
attribute.Since you’re working with entries, you could refactor your code a bit and just query your
cptCodes2
section byid
of yourcpt
value, which will be the entry id, and get the needed information based off of that.For example: