Wazza Posted November 14, 2022 Share Posted November 14, 2022 On the contact form on this page, I am wanting to change the html type of the 'date' field. Here is the desired change: Original: <input class="field-element text" type="text" id="text-yui_3_17_2_1_1541027265450_300449-field"> Desired: <input class="field-element text" type="date" id="text-yui_3_17_2_1_1541027265450_300449-field"> Could someone help me know what custom html to inject into the page's header? Link to comment
Beyondspace Posted November 14, 2022 Share Posted November 14, 2022 59 minutes ago, Wazza said: On the contact form on this page, I am wanting to change the html type of the 'date' field. Here is the desired change: Original: <input class="field-element text" type="text" id="text-yui_3_17_2_1_1541027265450_300449-field"> Desired: <input class="field-element text" type="date" id="text-yui_3_17_2_1_1541027265450_300449-field"> Could someone help me know what custom html to inject into the page's header? In order change attribute of HTML, you need javascript which is only available on Business Plan/ higher one. What is the final result you want to achieve? Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio pluginIf you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you Link to comment
Wazza Posted November 14, 2022 Author Share Posted November 14, 2022 I have business plan, so just after help with what javascript code to use. The intended result is to have the html type for the form field be date, so that web browsers can allow the date picker for data input. (See attached screenshot showing how this would look!) +++ The idea was inspired by zoxoxu's post on the following thread. But the code I haven't been able to get working. Here is what I have tried injecting into the header of the page: <script src="https://code.jquery.com/jquery-3.6.1.min.js" integrity="sha256-o88AwQnZB+VDvE9tvIXrMQaPlFFSUTR+nldQm1LuPXQ=" crossorigin="anonymous"></script> <script> $( document ).ready(function() { $('#text-yui_3_17_2_1_1541027265450_300449-field').attr("type", "date"); }); </script> Link to comment
Beyondspace Posted November 14, 2022 Share Posted November 14, 2022 12 minutes ago, Wazza said: I have business plan, so just after help with what javascript code to use. The intended result is to have the html type for the form field be date, so that web browsers can allow the date picker for data input. (See attached screenshot showing how this would look!) +++ The idea was inspired by zoxoxu's post on the following thread. But the code I haven't been able to get working. Here is what I have tried injecting into the header of the page: <script src="https://code.jquery.com/jquery-3.6.1.min.js" integrity="sha256-o88AwQnZB+VDvE9tvIXrMQaPlFFSUTR+nldQm1LuPXQ=" crossorigin="anonymous"></script> <script> $( document ).ready(function() { $('#text-yui_3_17_2_1_1541027265450_300449-field').attr("type", "date"); }); </script> So you have figured it out, right? Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio pluginIf you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you Link to comment
Wazza Posted November 16, 2022 Author Share Posted November 16, 2022 (edited) Unfortunately I haven't worked it out yet. I didn't have any success with the code I posted above. Would love some help! 🙂 Edited November 16, 2022 by Wazza Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment