Slider doesn't return to default value after validation error

Permalink Browser Info Environment
If after form submission there is a validation issue - eg. user doesn't fill in a required field - the slider control seems to reset to 0.

I am using a slider control with a default value set to 25 and if there are any validation issues and the form is reposted the slider resets to zero.

I am pretty sure this is a bug. Any chance this could be fixed quickly - or maybe you can let me know how to fix it - I am pretty good with php and javascript.

Thanks

Type: Discussion
Status: New
stingy
View Replies:
phatworks replied on at Permalink Reply
phatworks
I fix this now, thanks for letting me know.
phatworks replied on at Permalink Reply
phatworks
Ok the quick way to fix this, if you don't mind changing two lines of code, is to changes line #755 of "packages/forms_with_paypal_payment/blocks/form_with_paypal_payment/controller.php" to this:

value:' . stripslashes(htmlspecialchars(isset($_REQUEST['Question' . $msqID]) ? intval(str_replace('$', '', $val)) : $questionData['sliderDefault'])) . ',


And then change line #765 to this:

<input id="sliderAmount' . $si . '" name="Question' . $msqID . '" type="text" readonly="readonly" value="' . ($questionData['textAmount'] ? '$' : '') . stripslashes(htmlspecialchars(isset($_REQUEST['Question' . $msqID]) ? intval(str_replace('$', '', $val)) : $questionData['sliderDefault'])) . '" style="border: none; background: transparent;"><div id="hasSlider' . $si . '"></div>


Let me know if you have any questions. I'll add this fix to the next version of the add-on when I put out a new one.

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.