I am trying to implement a JQuery watermark on the textbox dynamically created by Silver Stripe $SearchForm. Without any success.
The search form is located in the header of the Page.ss file located in my themes folder.
Here is my code:
Page.php
----------------------
class Page_Controller extends ContentController {
public static $allowed_actions = array (
);
public function init() {
parent::init();
// Stylesheets
Requirements::themedCSS('default');
if($pos = strpos( $_SERVER[ 'HTTP_USER_AGENT' ], 'MSIE' ) ) {
Requirements::css("themes/dea/css/ie.css");
}
// JavaScript
Requirements::javascript('mysite/javascript/jquery-1.4.2.min.js');
Requirements::javascript('mysite/javascript/jquery.watermarkinput.js');
Requirements::javascript('mysite/javascript/dea.js');
}
}
dea.js
---------------------
$(document).ready(function(){
$("#SearchForm_SearchForm_Search").Watermark("Search the DEA");
});