Jump to content
  • 0

Styling Listboxes


marla45

Question

4 answers to this question

Recommended Posts

  • 0

Hi,

You can do this with javascript.

Insert folowing code into the footer of your datapage

f_a('YOURFIELDID').onmouseover = function(v_event){

if (!v_event) v_event=window.event;

var v_target = v_event.target ? v_event.target : v_event.srcElement;

if(v_event && v_target ){

if ( v_target.tagName.toLowerCase() == 'option' ) {

v_target.style.background="#eaeff5";

}

}

};

f_a('YOURFIELDID').onmouseout = function(v_event){

if (!v_event) v_event=window.event;

var v_target = v_event.target ? v_event.target : v_event.srcElement;

if(v_event && v_target ){

if ( v_target.tagName.toLowerCase() == 'option' ) {

v_target.style.background="#ffffff";

}

}

};

function f_a(v_id)

{

return document.getElementById(v_id);

}

And replace YOURFIELDID with correct listbox field id.

Let me know if this helps.

Link to comment
Share on other sites

  • 0

Hi, Thank you so much for your reply.

It did not work. My field is a listbox called Color

I added the following to my footer:

f_a('Color').onmouseover = function(v_event){

if (!v_event) v_event=window.event;

var v_target = v_event.target ? v_event.target : v_event.srcElement;

if(v_event && v_target ){

if ( v_target.tagName.toLowerCase() == 'option' ) {

v_target.style.background="#eaeff5";

}

}

};

f_a('Color').onmouseout = function(v_event){

if (!v_event) v_event=window.event;

var v_target = v_event.target ? v_event.target : v_event.srcElement;

if(v_event && v_target ){

if ( v_target.tagName.toLowerCase() == 'option' ) {

v_target.style.background="#ffffff";

}

}

};

function f_a(v_id)

{

return document.getElementById(v_id);

}

Did I miss something? Thanks!

Link to comment
Share on other sites

  • 0

Hi,

On different datapages fields have different id's.

For example, use firebug to inspect field ids.

For example, on the Submition form field ids begins with 'InsertRecord' and on the end there will be your field name 'InsertRecordColor'.

On the Search form field ids are replaced with 'Value1_1', 'Value2_1' etc. So if your listbox is the first element, then you should insert Value1_1 as YOURFIELDID in the code.

See example in the attachment.

Hope this helps.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...