Skip to content

fix: trim contact form values before sending to backend - #1007

Open
tylrx404 wants to merge 1 commit into
Shivayan09:mainfrom
tylrx404:fix/contact-form-trim-payload
Open

fix: trim contact form values before sending to backend#1007
tylrx404 wants to merge 1 commit into
Shivayan09:mainfrom
tylrx404:fix/contact-form-trim-payload

Conversation

@tylrx404

Copy link
Copy Markdown

Description

Closes #1001

Summary

This PR ensures that the contact form submits trimmed values instead of the raw user input.

Changes Made

  • Created a trimmedFormData object before making the API request.
  • Trimmed:
    • name
    • email
    • subject
    • message
  • Used the trimmed payload for both validation and submission.
  • Preserved the existing validation and user experience.

Why

Previously, the form validated trimmed values but submitted the original untrimmed values to the backend, allowing leading and trailing whitespace to be sent in the request payload.

Validation

  • Verified git diff --check passes successfully.
  • Ran npm run lint successfully (no new lint errors introduced; only pre-existing warnings remain).

@vercel

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

@tylrx404 is attempting to deploy a commit to the Shivayan's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Contact form sends extra spaces in submitted fields

1 participant