Streaming live at 10am (PST)

Changing submit button states - custom forms


#1

Quick (hopefully) question:

Context: I have a custom form that isn't being submitted to Webflow, I'm handling it internally. The problem is that the least 'submit-y' behavior I could get was to set Action = #...unfortunately, that still wipes the form entries, and clients will likely want to re-use their previous inputs.

My hack: I deleted the submit button and added a regular button (link) instead, attached javascript listeners to it, etc.

Question: Is there any way to set its property to say "Processing..."/disable the button like form submit buttons? And where would I change its appearance? Alternatively, if you know how to stop this form from clearing its inputs, that would work too. Ideally, once the response is received (after the server-side processing of the form), I can toggle the button back to accept new inputs.


#2

I don't know much about webflow yet but I think this can be done by JQuery easily...

When the form is submitted... Change the InnerHTML of the button to Processing...
Then once you recieve the completed trigger, change it back to Submit...
Similarly you could set the button to disabled...

$('#btn_submit').attr('disabled',true);

PS: I would suggest using JQuery since it's easier to use and is already imported by all webflow sites...


#3

Awesome, thanks. I wasn't sure if a jQuery approach would have it say "Processing" or not, but I hadn't thought of the innerHTML portion. I'll look into this into this.


#4

Great! Tell me if it works out for you! thumbsup


#5

Works like a charm smile . Had no idea I could innerHTML the text.


#6

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.