Strange javascript problem

Discussion in 'PHP' started by rockinaway, Mar 23, 2008.

  1. #1
    I have a perfectly working PHP file, that outputs my HTML page. However when I place the following, or any other javascript, into the page:

    
    <script language="JavaScript" type="text/javascript">
    
    function removeinput(x) 
    {
    	if (x.value == "Search...") 
    	{
    	x.value = '';
    	}
    }
    
    </script>
    
    Code (markup):
    It breaks the page and the stupid error of unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or '; is returned.

    The line it refers to is the second to last line of the file, that has the final ; of the block of HTML being outputted..

    What is the javascript doing to cause this?
     
    If someone posts a solution, use the "Best Answer" link in their post to pick it as the best answer.
    rockinaway, Mar 23, 2008 IP
  2. rockinaway

    rockinaway Guest

    Best Answers:
    0
    #2
    Hmmm, replacing the x.value = ' '; with x.value = " "; fixed it... Thanks anyway :)
     
    rockinaway, Mar 23, 2008 Set Best Answer IP