Jump to content

Subdomain feild on order form


mediadave

Recommended Posts

I would like to add a custom field on my order form for a subdomain. I can easily add the field under "Custom Fields" for the product.

 

However is there a way I can make it so if someone has already chosen the name it will inform them the name has already been chosen? I'm going to manually register the subdomain myself and I would just need the field to check and see if anyone else currently has that name in WHMCS.

 

I have already tried the "Subdomain Options" here: http://docs.whmcs.com/Products_and_Services#Other and this does not do what I am looking for.

Link to comment
Share on other sites

  • 2 weeks later...

there are probably a couple of ways to do this, but the one without coding or making template modification would be to use the following line in the regex validation of your custom field.

 

/^(?i)(?!.*\bdog\b)(?!.*\bcat\b).*$/

this will check the info entered into the custom field against either "dog" or "cat" - if it matches (case ignored), it displays the error below... if it doesn't match, the field is accepted... while 'dog' would be invalid, 'dogs' would be fine.

 

*custom field* value is not valid

"value is not valid" can be edited in the language files.

 

obviously, as you manually setup a valid subdomain order, you should add the subdomain to the above validation code too.

Edited by brian!
Link to comment
Share on other sites

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.   Paste as plain text instead

  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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated