This topic is locked

How to control initial value of search options dropdown box on Advance

11/11/2009 9:59:47 PM
PHPRunner Tips and Tricks
Sergey Kornilov admin

Lets say you want to make 'Between' selected instead of 'Equals' when Advanced Search page is loaded the first time.
PHPRunner 5.0/5.1
Paste the following code to the end of the search page in Visual Editor (HTML mode, right before </body> tag). Replace text in bold with correct field name (case sensitive).

<script>

function setSelectedIndex(s, v)

{

for ( var i = 0; i < s.options.length; i++ )

{

if ( s.options[i].text == v )

{

s.options[i].selected = true;

return;

}

}

}

setSelectedIndex(document.editform.asearchopt_fieldname,"Between"); ShowHideControls();

</script>