function webform_link_validate in Webform Link 6
Same name and namespace in other branches
- 7 components/link.inc \webform_link_validate()
Form validation handler.
If a link was submitted, check that the URL is valid.
1 string reference to 'webform_link_validate'
- _webform_render_link in components/
link.inc - Implements _webform_render_component().
File
- components/
link.inc, line 131 - Webform Link component
Code
function webform_link_validate($element, &$form_state) {
if ($element['#value'] && !valid_url($element['#value'], TRUE)) {
$message = t('%url is not a valid URL.', array(
'%url' => $element['#value'],
));
form_error($element, $message);
}
}