codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  html input box color assignment with javascript  ___ at 16:03 on Friday, February 17, 2006
 

I am trying to color and input box inside a ColdFusion program with a Javascript that is not called by an event.

<script language="javascript">
var x=<cfoutput>
'#x2#'
</cfoutput>,
y=<cfoutput>
'#x3#'
</cfoutput>;
alert(x+' '+y);
eval('f1.'+x+'.focus()')
eval('f1.'+x+'.style=\"background-color:#FF6A6A\"')
</script>

x is the input (not cfinput) box name and y is a string.
Have tried without the \s.

Setting focus works but setting color does not. What am I doing wrong?

Thankyou very much and sorry indentation lost.









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  JSP - Pagination
•  Re: dynamic crystal report generation
•  auto generate id
•  OnClick radio button problem Options
•  Re: Jbutton events
•  Re: changing the image of the button
•  Code which can read file names from a Web Folder into an Array
•  ASP.NET Import/Export
•  Difference between " " and ` ` in PERL


Recent Articles
Multiple submit buttons with form validation
Understanding Hibernate ORM for Java/J2EE
HTTP screen-scraping and caching
a javascript calculator
A simple way to JTable
Java Native Interface (JNI)
Parsing Dynamic Layouts
MagicGrid
Caching With ASP.Net
Creating CSS Buttons


© Copyright codetoad.com 2001-2006