You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To help users populating required fields we implemented a custom hook where fields gets updated in Javascript
// When a user click TRY iT OUT BUTTON we want to fill the form for the userfunctionhookTryItOutButton(){letswaggerOperations=document.querySelectorAll(".try-out__btn");for(constswaggerOpofswaggerOperations){swaggerOp.addEventListener("click",function(event){setTimeout(fillSwaggerForm,100);});}}functionfillSwaggerForm(){letinputFields=document.querySelectorAll("input[type=text]");for(constinputFieldofinputFields){if(inputField.hasAttribute("placeholder")&&inputField.getAttribute("placeholder").startsWith("X-Cassandra-Token")){inputField.value=document.getElementById("astra_token").value;inputField.style.color="#008800";inputField.style.backgroundColor="#eeffee";inputField.style.border="1px solid #008800";inputField.dispatchEvent(newEvent("change"));inputField.dispatchEvent(newEvent("onchange"));}elseif(inputField.hasAttribute("placeholder")&&inputField.getAttribute("placeholder").startsWith("namespace-id")){inputField.value=document.getElementById("astra_namespace").value;inputField.style.color="#008800";inputField.style.backgroundColor="#eeffee";inputField.style.border="1px solid #008800";inputField.dispatchEvent(newEvent("change"));inputField.dispatchEvent(newEvent("onchange"));}}}
The fields are populated as expected (cf screenshots). Unfortunately when in click the button EXECUTE everything happen as the fields were not populated (input field shake and values back to placeholder.
Is there any event I can trigger on the input field for the form to consider them populated ? We tried Input, Keyspress as well.
The text was updated successfully, but these errors were encountered:
Q&A (please complete the following information)
Content & configuration
Swagger/OpenAPI definition:
Swagger-UI configuration options:
Screenshots
How can we help?
To help users populating required fields we implemented a custom hook where fields gets updated in Javascript
The fields are populated as expected (cf screenshots). Unfortunately when in click the button
EXECUTE
everything happen as the fields were not populated (input field shake and values back to placeholder.Is there any event I can trigger on the input field for the form to consider them populated ? We tried Input, Keyspress as well.
The text was updated successfully, but these errors were encountered: