How do I validate a nodereference field in a custom node form in Drupal 6?

If you can pass the SUSPENDED information somehow to views, then you can limit the nodes one chooses in the nodereference using a view. Then nodereference will take care for validation if the user entered a node not in the list.

Up vote 0 down vote favorite share g+ share fb share tw.

I have an autocomplete nodereference field (field_hostnamelastref) in a custom pass-node-form.tpl.php. The field references four items (last name, first name, an id #, and status) generated from tokens in an autotitle from another content type. When entering a last name in the nodereference field, if the corresponding status for that last name is "SUSPENDED", I would like to be able to validate that field with an error message and block form submission.

This is my first attempt at writing my own validation and am not having any luck. Have tried many different ways ereg, preg-match and strpos. Below is my latest attempt: $type->name))); } }?

> Not sure if I'm even in the ball park on this. Any help much appreciated! Validation drupal form-validation link|improve this question edited Jun 13 '11 at 20:38Laxman133,6123615 asked May 13 '09 at 19:45jdm843.

If you can pass the SUSPENDED information somehow to views, then you can limit the nodes one chooses in the nodereference using a view. Then nodereference will take care for validation if the user entered a node not in the list. But I am not sure I understood your question.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions