Javascript Button Issues - Created...
Short Version: I created a js radio button in an HTML Element -- how do I keep it from trying to submit my form?
Details:
I have a very long form, and am using a radio button for navigation. The main issue I'm having is that when the next 'page' is selected, and the next set of elements show, the web page is at the bottom of the page (the location of the navigaton radio button).
The goal is to scroll to the top.
I've created a js button that sets the value of the navigation radio button (which I'll probably hide) and scrolls to the top of the page. Works great... almost.
Issues:
1) The form gets submitted -- there's nothing submit-like in my js, not sure what the issue is and couldn't find a related issue in the forums.
2) Testing on local, the radio button gets set, but the display doesn't change -- We'll see, but appears to work on the web, just errors out with the 'submit' issue.
Here's a link to a sample version on the web -- "navFront" is the button:
http://sumpterconstructionllc.com/CC/TEST1.php?1234321
Here's the .fb:
http://sumpterconstructionllc.com/CC/Temp/Test1.fb
(As I've mentioned in the past, I'll be going far away soon, so I wanna keep it simple of not get outside of WFB for the fix).
Details:
I have a very long form, and am using a radio button for navigation. The main issue I'm having is that when the next 'page' is selected, and the next set of elements show, the web page is at the bottom of the page (the location of the navigaton radio button).
The goal is to scroll to the top.
I've created a js button that sets the value of the navigation radio button (which I'll probably hide) and scrolls to the top of the page. Works great... almost.
Issues:
1) The form gets submitted -- there's nothing submit-like in my js, not sure what the issue is and couldn't find a related issue in the forums.
2) Testing on local, the radio button gets set, but the display doesn't change -- We'll see, but appears to work on the web, just errors out with the 'submit' issue.
Here's a link to a sample version on the web -- "navFront" is the button:
http://sumpterconstructionllc.com/CC/TEST1.php?1234321
Here's the .fb:
http://sumpterconstructionllc.com/CC/Temp/Test1.fb
(As I've mentioned in the past, I'll be going far away soon, so I wanna keep it simple of not get outside of WFB for the fix).
Hi Crashed,
Take a look at this thread.
http://www.coffeecup.com/forums/welcome … it-button/
Probably this.
Take a look at this thread.

http://www.coffeecup.com/forums/welcome … it-button/
Probably this.
<button onclick="navFunction(); return false;">NavFront</button>
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.
This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
It's easy to overlook something you're not looking for.
This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
Thanks, Eric. First half of the issue resolved. As you said, it was defaulting to a submit button, so I added the below to specify the type:
type="button"
Now, there's gotta be a simple way to refresh the elements that show based on the conditionals... when you manually click the radio button, the conditionals on the page are 'refreshed'. Now I'll just stick my ignorance out in the open for all to see: what's the trigger? I need to trigger that functionality, that refresh. Make sense?
I'll be over on stackoverflow trying to learn... we need a bigger coffee pot in this RV!
type="button"
Now, there's gotta be a simple way to refresh the elements that show based on the conditionals... when you manually click the radio button, the conditionals on the page are 'refreshed'. Now I'll just stick my ignorance out in the open for all to see: what's the trigger? I need to trigger that functionality, that refresh. Make sense?
I'll be over on stackoverflow trying to learn... we need a bigger coffee pot in this RV!
OK, I screwed up on the first line of the initial post (though it's correct in the rest of the post)... it's a BUTTON, not a radio button.
The button (1)sets the value of a radio button and (2)scrolls to the top of the page. The radio button is used for navigation, to simulate page changes, with each group of elements all set to show based on the selected radio button item. When the button is working, I'll hide the radio button and the user will just see buttons to navigate.
The button (1)sets the value of a radio button and (2)scrolls to the top of the page. The radio button is used for navigation, to simulate page changes, with each group of elements all set to show based on the selected radio button item. When the button is working, I'll hide the radio button and the user will just see buttons to navigate.
I would use JQuery. I find it easier to code and has more options especially with plugins.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.
This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
It's easy to overlook something you're not looking for.
This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
JQuery to refresh the CSS on the page?
This functionality is already built in to WFB, I think I just need the hook to trigger it. Otherwise I believe I'd have to reinvent the wheel to deal with hundreds of fields that are set up to conditionally show based on the value of the radio button (my 'real' form is just a bit larger than the test form, and there're actually 9 entirely unique forms in the series).
I should be able to simply call the WFB js function from the function called by the button, I just can't figure out the function I need to call and the parameters to send.
I'll go read up on JQuery, maybe it's something simple I'm missing? My heavy Web App development days were pre-php/pre-JQuery, and I've been away for awhile...
This functionality is already built in to WFB, I think I just need the hook to trigger it. Otherwise I believe I'd have to reinvent the wheel to deal with hundreds of fields that are set up to conditionally show based on the value of the radio button (my 'real' form is just a bit larger than the test form, and there're actually 9 entirely unique forms in the series).
I should be able to simply call the WFB js function from the function called by the button, I just can't figure out the function I need to call and the parameters to send.
I'll go read up on JQuery, maybe it's something simple I'm missing? My heavy Web App development days were pre-php/pre-JQuery, and I've been away for awhile...
Ok I miss understood what you where after. I thought you were writing your own scripts.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.
This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
It's easy to overlook something you're not looking for.
This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
I wrote the scripts to set the radio button selection and scroll-to-top. Just need to refresh CSS now, so that setting the radio button selection programmatically functions the same as setting the radio button manually.
Since the Subject issue is resolved, I started a new thread for just the CSS refresh issue.
http://www.coffeecup.com/forums/web-form-builder/refresh-css-conditionals-from-an-html-element/
http://www.coffeecup.com/forums/web-form-builder/refresh-css-conditionals-from-an-html-element/
Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.