Jump to content

Change Css Style For One Field On Datapage


Recommended Posts

I have tried searching the forums, and can't seem to figure this out.  How do I get the CSS styles placed in the header to change just one field?  

 

For example, if I have a field titled "GA_Campaign", the ID for that field seems to be putting a random string of characters at the end  (i.e. InsertRecordGA_Campaign_04660113417).  However, that random string of numbers changes each time the data form is reloaded.

 

How would I set it so that the border for that field is 0px?

Link to comment
Share on other sites

  • 1 month later...

Hello Aukirk,

 

And one more thing - as far as I know, it is requires some additional code to find the cascading field by ID.

So, if you work with a not cascading field and want to change, for example, color of the field, you can use the following code:

<script type="text/javascript">
var textfield = document.getElementById("InsertRecordFIELDNAME");
textfield.style.color="#ff0000";
</script>

But if the field is cascading, the following code will work:

<script type="text/javascript">
var elems = document.getElementsByTagName("*");
for (var i=0, m=elems.length; i<m; i++) 
  {
    if (elems[i].id && elems[i].id.indexOf("InsertRecordFIELDNAME") != -1) 
     {
        var textfield = elems[i];
     }
}
alert(textfield);
textfield.style.color="#ff0000";
</script>
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
Reply to this topic...

×   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...