Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Arnaud Schenk
Courses Plus Student 2,957 PointsValidate paypal form to stop edited HTML to be sent? [Shirts4Mike]
How would you go about validating that the HTML matches the price or shirt id, to stop people from submitting forms with an edited name or size?
1 Answer

Patrick Cooney
12,216 PointsI would write some custom JavaScript to do string comparisons on the client side. You can do it server-side but its not as efficient.
Arnaud Schenk
Courses Plus Student 2,957 PointsArnaud Schenk
Courses Plus Student 2,957 PointsCouldn't the potentially mischievous user just modify the javascript to validate the fake form?
Patrick Cooney
12,216 PointsPatrick Cooney
12,216 PointsYou know, that's a really good question. I know you can inspect and edit JavaScript with most developer tools but I'm not sure if it would persist through the form submission process. If you're really worried about it do it server side. It takes a little longer for the user but if it gives you peace of mind it may be worth it.
Either way you choose to do it you'll just do some simple string comparisons.