PHP query problem

Discussion in 'PHP' started by izlik, Dec 27, 2008.

  1. #1
    Hello. i have this code bellow that im getting an error from in IE only. in firefox it works but in IE i get "error: 'imgcontent' is null or not an object" AND "error: 'document.form' is null or not an object" how can this be solved?

    function checkForm(form)
    {
    	if(form.imgcontent.selectedIndex > 0) {
    		document.form.submit();
    	} else {
    		alert('Please Select Image content Type');
    		return false;
    	}
    }
    PHP:
     
    izlik, Dec 27, 2008 IP
  2. maestria

    maestria Well-Known Member

    Messages:
    705
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    110
    #2
    have you enabled java script in the IE?
     
    maestria, Dec 27, 2008 IP
  3. Yesideez

    Yesideez Peon

    Messages:
    196
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    If you're validating your data using Javascript don't rely on it as some people don't have Javascript enabled either through choice or viewing on a device that doesn't support it - always validate with PHP as well.
     
    Yesideez, Dec 27, 2008 IP
  4. mdrobiul

    mdrobiul Peon

    Messages:
    186
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Did you use <script> tag for for javascript ? or include java script file ?
     
    mdrobiul, Dec 27, 2008 IP
  5. izlik

    izlik Well-Known Member

    Messages:
    2,399
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    185
    #5
    there is script tags for it.
     
    izlik, Dec 27, 2008 IP
  6. farad

    farad Peon

    Messages:
    55
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    What's the name of your form .. ?
    Change your code to something like this :
    <form name="testform">
    
    document.testform.submit();
    PHP:
     
    farad, Dec 27, 2008 IP