Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Javascript equivalent of form action

Featured Replies

I have a form that is going to be used to take credit card details, when the submit button is clicked, a javascript checks the the credit card information, the then the form action is used to process the cgi script that saves the form data on my server.

 

The problem im having is that the form action is being processed whether the card details are correct or not, i need the form action to only go through if the details are correct.

 

I was thinking of deleting the action from the form, and replacing the "alert("This card number appears to be valid.");" string of the javascript with the form action, however im clueless with javascript and dont know what write here.

 

Any ideas?

 

Thanks in advance

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.