Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CampTix Indian Payments: Use form context for phone validation #1409

Merged
merged 1 commit into from
Oct 21, 2024

Conversation

ryelle
Copy link
Contributor

@ryelle ryelle commented Oct 21, 2024

Fixes #1408 — When buying a ticket using the "Indian Payments" addon, a required phone number field is added. This field is then validated with some simple javascript, but previously the script would look for anything with the mobile class. On mobile devices, the admin bar has this class, so the first value found was always an empty string, an invalid value.

This was likely not a problem in the past, because logged-out users would not have an admin bar.

How to test the changes in this Pull Request:

Test on a sandbox on kerala or dehli WordCamps (or https://events.wordpress.org/rentest/2024/test-events/)

Set up locally:

  1. Set up a site with CampTix and the CampTix Indian Payments
  2. Enable the payment processor Instamojo
  3. Create a ticket

To test:

  1. Use a mobile device, or set the browser responsive design mode to use a phone user agent & touch controls
  2. Log in to the site
  3. Buy a ticket
  4. Fill out the phone field with valid numbers using any format (only numbers, number and space, etc)
  5. The form should not error with "Please enter only numbers"

You might see the 10-digit number error depending on what was entered.

@ryelle ryelle added the [Component] CampTix Including addons label Oct 21, 2024
@ryelle ryelle self-assigned this Oct 21, 2024
@ryelle ryelle merged commit daed281 into production Oct 21, 2024
3 checks passed
@ryelle ryelle deleted the fix/camptix-indian-payment-phone branch October 21, 2024 22:31
@pkevan
Copy link
Contributor

pkevan commented Oct 22, 2024

Thanks @ryelle !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Component] CampTix Including addons
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Phone Number Field Validation Not Working – Unable to Purchase WordCamp Tickets
2 participants