I would like to check the field on the form to make sure it contains the correct formatting for the URL associated with the Vimeo video. The following is what I have in Javascript, but I need to convert this to PHP (not my single)
Basically, I need to check this field, and if it is not formatted correctly, I need to save the error message as a variable. If this is correct, I keep the variable empty.
// Parse the URL var PreviewID = jQuery("#customfields-tf-1-tf").val().match(/http:\/\/(www.vimeo|vimeo)\.com(\/|\/clip:)(\d+)(.*?)/); if ( !PreviewID ) { jQuery("#cleaner").html('<div id="vvqvideopreview"><?php echo $this->js_escape( __("Unable to parse preview URL. Please make sure it the <strong>full</strong> URL and a valid one at that.", 'vipers-video-quicktags') ); ?></div>'); return; }
The traditional vimeo URL is as follows: http://www.vimeo.com/10793773
Thanks!
source share