Jump to content

[SOLVED] Form doesnt submit if validated


dezkit

Recommended Posts

My form doesn't submit if it is validated.

 

      function checkpostal(){
            var themessage = "You are required to complete the following fields: ";
            var re5digit="STEAM_[0|1]:[0|1]:[0-9]+";
            if (document.form.os1.value.search(re5digit)==-1){
            alert('Please enter a valid SteamID.\nSteamID has to be in the form of "STEAM_0:x:xxxxx"');
            } else {
            return true;
            }
      }

 

anyhelp?

Link to comment
Share on other sites

I think on the form you would add

<form onsubmit="return checkpostal()" name="steamid_form">

 

and in function checkpostal() you would have

 

document.steamid_form.submit()  instead of return true;

 

if anything, I would think that you would need the "return checkpostal()".

We would need to see the form code to be sure, and test ourselves.

Link to comment
Share on other sites

<SCRIPT TYPE="text/javascript">
      function checkpostal(){
            var themessage = "You are required to complete the following fields: ";
            var re5digit="STEAM_[0|1]:[0|1]:[0-9]+";
            if (document.form.os1.value.search(re5digit)==-1){
            alert('Please enter a valid SteamID.\nSteamID has to be in the form of "STEAM_0:0:123456"\nIf you do not know how to find your SteamID, press on the HELP? link.');
            } else {
            document.form.submit()
            }
      }
</script>

 

solved.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.