www.webdeveloper.com
Results 1 to 11 of 11

Thread: Javascript don't work on IE

Threaded View

  1. #1
    Join Date
    Apr 2009
    Posts
    23

    Javascript don't work on IE

    The previous developer who has been working here used javascript on some forms and they're not functioning properly when opened with IE (any version)

    The link to the form: [LINK]

    On firefox, it doesn't prompt any error and as you can see, it auto selects "Lebanon" as a country and it selects the date with 3 days in between till the return date. These don't work on IE, it just shows blank.

    Here is the javascript used.
    Code:
    $cargroup=$_GET["group"];
    $countryofrental = $_GET["cor"];
    $countryofresidence = $_GET["corofres"];
    $daycoll = date("d") + 2;
    $mthcoll = $_GET["monthcoll"];
    $yearcoll = date("Y");
    $hr = $_GET["hr"];
    
    $dayret = date("d") + 5;
    $mthret = date("m");
    $yearret = date("Y");
    echo '
    <script type="text/javascript">
    function setvalue(){
    var x=document.getElementById("cargroup");
    x.value='.$cargroup.'
    }
    function setvaluectr(){
    var x=document.getElementById("countryofrental");
    x.value='.$countryofrental.'
    }
    function setvaluectrofres(){
    var x=document.getElementById("countryofresidence");
    x.value='.$countryofresidence.'
    }
    function setdaycoll(){
    var x=document.getElementById("daycoll");
    x.value='.$daycoll.'
    }
    function setmthcoll(){
    var x=document.getElementById("monthcoll");
    x.value='.$mthcoll.'
    }
    function setyearcoll(){
    var x=document.getElementById("yearcoll");
    x.value='.$yearcoll.'
    }
    function sethrcoll(){
    var x=document.getElementById("hrcoll");
    x.value='.$hr.'
    }
    
    
    function setdayret(){
    var x=document.getElementById("dayret");
    x.value='.$dayret.'
    }
    function setmthret(){
    var x=document.getElementById("monthret");
    x.value='.$mthret.'
    }
    function setyearret(){
    var x=document.getElementById("yearret");
    x.value='.$yearret.'
    }
    function sethrret(){
    var x=document.getElementById("hrret");
    x.value='.$hr.'
    }
    </script>';
    and here is the call page
    Code:
    <div align="left" style="width:100%" class="componentheading">{formtitle}</div>
    
    <div align="left" style="width:80%;" id="rsform-div">
    <div id="rsform-mandatory">* Mandatory fields</div><br>
    <form name="{formname}" id="{formname}" id="rsform-form" method="post" action="{action}" {enctype}>
    	<table width="100%" border="0" cellpadding="0" cellspacing="0" class="forme">
    	{formfields}
    	</table>
    </form>
    </div>
    <script type="text/javascript">
    setvalue();
    setvaluectr();
    setvaluectrofres();
    setdaycoll();
    setmthcoll();
    setyearcoll();
    sethrcoll();
    
    setdayret();
    setmthret();
    setyearret();
    sethrret();
    </script>
    Any advise? Thanks.
    Last edited by drugoholic; 04-15-2009 at 08:54 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles