Home›Forums›Feature Requests›Volunteer Sign-Up Sheets – Feature Requests›Prevent page reload›Reply To: Prevent page reload
I actually fixed a lot of my problem by showing and hiding the forms using :target CSS. One last problem would be appending the correct anchor to the url so that the correct form stays showing after:
1) Clicking “Sign Up >”
and
2) Clicking “< Go back to sign up sheet”
Currently, this is what happens:
1) Starting URL: site.com/volunteer
2) After user selects form name from menu: site.com/volunteer/#formX
3) Form appears, user selects “Sign Up >”: site.com/volunteer/?sheet_id=1&task_id=2&date=2016-06-30
*needs to have #formX still appended to the end.
4)Manually adding #formX to the end, it works – then click “back to sign up sheet”, it once again drops the fragment.
Would this be fairly easy to do using JavaScript in combination with the plugin’s php?
For example, at line 778 of class-pta_sus_public.php, could you pass in a variable containing the fragment, which was collected using JavaScript?
<a href="'.esc_url($go_back_url).' . $FRAGMENT">
I’m not sure if your form is GET or POST or exactly how to complete this – I have very limited knowledge of PHP.
Is there a short PHP function that could accomplish grabbing the fragment from the JavaScript function?
Thanks in advance for your help, as well as creating a great free plugin.
- This reply was modified 9 years, 6 months ago by Matt Stern.