After adding paypal buttons to my catalog, I needed to validate that selections had been made (color choices) before submitting the form. I did a million searches and only came up with answers that took me deep, deep into some really scary coding. I had previously had this working on another html-only site - so I had javascript that I knew would work - but I couldn't figure out how to implement the check using views; I couldn't figure out how to get the js into my view.

Here's what worked for me: To place javascript into your view, add a php field, copy the javascript you'd like to use surrounded by the "script type" opening and closing tags you'll see below in my example, (where 'ColorSelection' is the form name and the input element "select" name is 'os0'). Just paste it there with no php tags (as my example below) - which places the js on the page, allowing it to be called by your form (which I simply placed into a separate php field). I just used a php field to get past the drupal filter.

Bear in mind, I am far from any type of programmer - use this at your own risk as it only serves to point folks in the right direction.

My example:

function validate_form ( ) { valid = true; if ( document.ColorSelection.os0.selectedIndex == 0 ) { alert ( "Please select a style from the dropdown menu." ); valid = false; } return valid; }

Hope this saves somebody else the two days it took me to figure out. Those more accomplished with Drupal are encouraged to make corrections or simplifications as warranted.