SitePoint Sponsor

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 25 of 27
  1. #1
    SitePoint Zealot
    Join Date
    Mar 2011
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    object doesn't support this object in javascript

    Hi i'm new to javascript but i think my code works well in firefox and other browser, but when i try to run in IE i got the error "object doesn't support this object in javascript".

    Can anyone tell me why i always got this error. Many thanks..

    Here is my whole code.

    Code PHP:
    <?php
    session_start();
    if(isset($_SESSION['username'])){
    include_once("conn.php");
     
     
      $pendtickets = array();
      $newtickets=array();
    	 $selectTicketsQuery = mssql_query("Select * from tblTicket inner join tblAssign on tblTicket.TickNo=tblAssign.TicketNo and tblAssign .AssignTo!= '$_SESSION[username]' ");
    	 while($pendticket = mssql_fetch_array($selectTicketsQuery)){
            $pendtickets[] = $pendticket;
    		}
    	$newtickno=mssql_query("Select * from tblTicket where TickNo not in (select TicketNo from tblAssign)");
    	 while($newticket = mssql_fetch_array($newtickno)){
            $newtickets[] = $newticket;
    		}
    	$Assignto= mssql_query("Select * from MISPIC");
    	while($AssignOptionassignto = mssql_fetch_array($Assignto)){
    	$AssignOptionsassignto[] = $AssignOptionassignto;
    	}
     
    	$Assign= mssql_query("Select * from MISPIC ");
    							while($AssignOption = mssql_fetch_array($Assign)){
    							$AssignOptions[] = $AssignOption;
    							}
     
    ?>
    	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
     
    	<script type="text/javascript" language="javascript" src="jquery./jquery.js"></script>
    	<script type="text/javascript" language="javascript" src="jquery./jquery.dataTables.js"></script>
    	<script type="text/javascript" charset="utf-8">
    		$(document).ready(function() {
    		$('#example').dataTable();
    		} );
    	</script>	
    	<script type="text/javascript" charset="utf-8">
     
     
    </script>
     
    <?php echo '<meta http-equiv="refresh" content="60;url="UnAssignticket.php">';?>
    	  <style type="text/css">
    form {
        float:left;
    }
    </style>
    	</head>
     
    <body id="dt_example">
    <br/>
    <br/>
    <p>
    <table  BORDERCOLOR="#0B0B0B" border='1' bgcolor="#F5F5FA" width="100%"  align='center'>
    <tr>
    	<td >
    		<img src='img/pend.png'>
    	</td>
    </tr>
    <tr>
    	<td align='center'>
    		<div align='left' id="containerpend">
    			<div id="demo">
    				<table BORDERCOLOR="#0B0B0B"  frame="box" cellpadding="0" cellspacing="0" frame="box"  class="display" id="example"> 
     
    			<thead>
    				<tr>
    					<th><a title="Ticket Number">Ticket No.</a></th>
    					<th><a title="Ticket Create By">Create By</a></th>
    					<th><a title="Ticket Create Date">Create Date</a></th>
    					<th><a title="Date Assigned">Date Assigned</a></th>
    					<th><a title="Problem Error">Problem Description</a></th>
    					<th><a title="Ticket Assigned To">Assign To</a></th>
    					<th><a title="User Action">Action</a></th>
    				</tr>
    			</thead>
    			<tbody>			
    					<?php	foreach($pendtickets as $pendticket) 
     
    					{?>
     
    							<tr class="GradeA">
    								<td class='center'><?php echo "<a href='viewassignticket.php?id={$pendticket['TickNo']}&uname={$pendticket['UserName']}' title='View Ticket'>".$pendticket['TicketNo']."</a>"?></td>
    								<td class='center'><?php echo $pendticket['UserName'];?></td>
    								<td class='center'><?php echo $pendticket['DateCreate'];?></td>
    								<td class='center'><?php echo $pendticket['DateAssign'];?></td>
    								<td class='center'><?php echo $pendticket['Category']." (".$pendticket['Subcat'].")"?></td>
    								<td class='center'><?php echo $pendticket['AssignTo'];?></td>
    								<td class='center'>
     
    								<form  id='transfer'  name='transfer' class='transfer'  action='forwardtick.php' method='POST' >
    								<?php 	$_SESSION['ticketassign']=$pendticket['TicketNo']; 
    										$_SESSION['nameassign']=$pendticket['AssignTo']; 
    								?>
    										<select  name='Trans' onchange="Transferticket('<?php echo $pendticket['TickNo'];?>',$(this));">
    											<option value="0">Please Select</option>
    											<?php foreach($AssignOptions as $TransferOption){ 
    											 if ($TransferOption['MISPIC'] != $pendticket['AssignTo'])	
    											echo '<option value="', $TransferOption['MISPIC'], '">', $TransferOption['MISPIC'], '</option>'; }	
     
    											?> 
    										</select>
     
    									</form>
    								</td>
     
    							</tr>
    					<?php }	?>
    						<?php foreach($newtickets as $newticket) { ?>
    							<tr class="GradeA">
    								<td class='center'><?php echo "<a href='ticketinfo.php?id={$newticket['TickNo']}' title='View Ticket'>".$newticket['TickNo']."</a>"?></td>
    								<td class='center'><?php echo $newticket['UserName'];?></td>
    								<td class='center'><?php echo $newticket['DateCreate'];?></td>
    								<td class='center'><?php echo $newticket['DateAssign'];?></td>
    								<td class='center'><?php echo $newticket['Category']." (".$newticket['Subcat'].")"?></td>
    								<td class='center'><?php echo $newticket['AssignTo'];?></td>
     
    								<td class='center'>
     
    									<form id='assigned'  name="assigned" class='assigned'  action='asstoticket.php' method='POST'  >
    									<?php 	$_SESSION['assignticketno']=$newticket['TickNo']; ?>
    										<select style="width:100%" id='assignto' name='assignto' onchange="TicketAss('<?php echo $newticket['TickNo'];?>','<?php echo $newticket['UserName'];?>',$(this));" >
     
    											<option value="0">Please Select</option>
     
    											<?php foreach($AssignOptionsassignto as $TransferOptionassignto){ 
    											echo '<option  value="', $TransferOptionassignto['MISPIC'], '">', $TransferOptionassignto['MISPIC'], '</option>'; 
    										}
    											?> 
    										</select>
     
    									</form>
    								</td>
     
    							</tr>
    					<?php }	?>
    			</tbody>
    				<tfoot>
    					<th>Ticket No</th>
    					<th>Create By</th>
    					<th>Create Date</th>
    					<th>Date Assigned</th>
    					<th>Problem Description</th>
    					<th>Assign To</th>
    					<th>Action</th>	    
    			</tfoot>			
    		</table>
     
    			</div>
    		</div>
    	</td>	
    </tr>
    </table	>
    </p>
     
    <script type="text/javascript" charset="utf-8">
    function Transferticket(ticket,uVal) {
        if (window.confirm('Transfer this ticket number ' + ticket + ' to ' + uVal.val())) {
     
        //this is where i got the error
    	   window.document.forms['transfer'].submit();
     
     
        }else{
    	uVal.val(0);
    	};
    }
    var forms = document.getElementsByTagName('transfer'),
        i;
    for (i = 0; i < forms.length; i += 1) {
        if (forms[i].className === 'transfer') {
            forms[i].onchange = Transferticket;
        }
    }
    </script>
     
    <script type="text/javascript" charset="utf-8">
     
    function TicketAss(ticketno,cname,sVal) {
        if (window.confirm('Assign this ticket number ' + ticketno + ' to ' + sVal.val())) {
     
          //this is where i got the error
           window.document.forms['assigned'].submit();
     
     
        }else{
    	sVal.val(0);
    	};
    }
     
    var forms1 = document.getElementsByTagName('assigned'),
        i;
    for (i = 0; i < forms1.length; i += 1) {
        if (forms[i].className === 'assigned') {
            forms[i].onchange = TicketAss;
        }
    }
     
    </script>
     
    	<style type="text/css" title="currentStyle">
    		@import "css/demo_page.css";
    		@import "css/demo_table.css";
    	</style>
     
    	</body>
    	</html>
    <?php
     
    }else{ //not logged in
        header('location: login.php');
    }
    ?>

  2. #2
    SitePoint Wizard bronze trophy chris.upjohn's Avatar
    Join Date
    Apr 2010
    Location
    Melbourne, AU
    Posts
    2,183
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Simply remove the window. part as document. is fine on its own
    Blog/Portfolio | Evolution Xtreme | DFG Design | DFG Hosting | CSS-Tricks | Stack Overflow | Paul Irish
    Having lame problems with your code? Let us help by using a jsFiddle

  3. #3
    SitePoint Zealot
    Join Date
    Mar 2011
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the reply..

    i tried it already but still the same...any more suggestion?

  4. #4
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by ryoka012 View Post
    i tried it already but still the same...any more suggestion?
    Take a closer look at this part:

    Code javascript:
    var forms1 = document.getElementsByTagName('assigned'),
        i;
    for (i = 0; i < forms1.length; i += 1) {
        if (forms[i].className === 'assigned') {
            forms[i].onchange = TicketAss;
        }
    }
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  5. #5
    SitePoint Zealot
    Join Date
    Mar 2011
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the replay.

    I notice it and made a changes but still the same error appear..

    Code JavaScript:
     
    <script type="text/javascript" charset="utf-8">
    function Transferticket(ticket,uVal) {
        if (window.confirm('Transfer this ticket number ' + ticket + ' to ' + uVal.val())) {
           	   document.forms['transfer'].submit();
    	}else{
    	uVal.val(0);
    	};
    }
    var trans = document.getElementsByTagName('transfer'),
        y;
    for (i = 0; y < trans.length; y += 1) {
        if (trans[y].className === 'transfer') {
            trans[y].onchange = Transferticket;
        }
    }
    </script>
     
    <script type="text/javascript" charset="utf-8">
     
    function TicketAss(ticketno,cname,sVal) {
        if (window.confirm('Assign this ticket number ' + ticketno + ' to ' + sVal.val())) {
           document.forms['assigned'].submit();
        }else{
    	sVal.val(0);
    	};
    }
    var ass = document.getElementsByTagName('assigned'),
        i;
    for (i = 0; i < ass.length; i += 1) {
        if (ass[i].className === 'assigned') {
            ass[i].onchange = TicketAss;
        }
    }
    </script>

  6. #6
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    4 Thread(s)
    Next up, are uVal and sVal appropriate jQuery objects?
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  7. #7
    SitePoint Zealot
    Join Date
    Mar 2011
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes..they are,i tried to use window.location.href

    i works fine,but when i tied to use that syntax i got an error.

  8. #8
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by ryoka012 View Post
    yes..they are,i tried to use window.location.href

    i works fine,but when i tied to use that syntax i got an error.
    Can you provide more information about the error? Where it's happening, what line number is the error occurring on, or even what the object is supposed to be?

    How about linking us to a test page where the problem can be experienced?
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  9. #9
    SitePoint Zealot
    Join Date
    Mar 2011
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry i can't give you a link..

    but here is the information
    Here is what the error said:"Object doesen't support this property or method"
    its on line 179
    and char 12

    This the Javascript code.

    Code JavaScript:
     
    <script type="text/javascript" charset="utf-8">
    function Transferticket(ticket,uVal) {
        if (window.confirm('Transfer this ticket number ' + ticket + ' to ' + uVal.val())) {
                //here is where the error occur line 179
               document.forms['transfer'].submit();
        }else{
        uVal.val(0);
        };
    }
    var trans = document.getElementsByTagName('transfer'),
        y;
    for (i = 0; y < trans.length; y += 1) {
        if (trans[y].className === 'transfer') {
            trans[y].onchange = Transferticket;
        }
    }
    </script>
     
    <script type="text/javascript" charset="utf-8">
     
    function TicketAss(ticketno,cname,sVal) {
        if (window.confirm('Assign this ticket number ' + ticketno + ' to ' + sVal.val())) {
          //here is where the error occur
           document.forms['assigned'].submit();
        }else{
        sVal.val(0);
        };
    }
    var ass = document.getElementsByTagName('assigned'),
        i;
    for (i = 0; i < ass.length; i += 1) {
        if (ass[i].className === 'assigned') {
            ass[i].onchange = TicketAss;
        }
    }
    </script>


    And here is the whole code..
    Code PHP:
    <?php
    session_start();
    if(isset($_SESSION['username'])){
    include_once("conn.php");
     
     
      $pendtickets = array();
      $newtickets=array();
    	 $selectTicketsQuery = mssql_query("Select * from tblTicket inner join tblAssign on tblTicket.TickNo=tblAssign.TicketNo and tblAssign .AssignTo!= '$_SESSION[username]' ");
    	 while($pendticket = mssql_fetch_array($selectTicketsQuery)){
            $pendtickets[] = $pendticket;
    		}
    	$newtickno=mssql_query("Select * from tblTicket where TickNo not in (select TicketNo from tblAssign)");
    	 while($newticket = mssql_fetch_array($newtickno)){
            $newtickets[] = $newticket;
    		}
    	$Assignto= mssql_query("Select * from MISPIC");
    	while($AssignOptionassignto = mssql_fetch_array($Assignto)){
    	$AssignOptionsassignto[] = $AssignOptionassignto;
    	}
     
    	$Assign= mssql_query("Select * from MISPIC ");
    							while($AssignOption = mssql_fetch_array($Assign)){
    							$AssignOptions[] = $AssignOption;
    							}
     
    ?>
    	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
     
    	<script type="text/javascript" language="javascript" src="jquery./jquery.js"></script>
    	<script type="text/javascript" language="javascript" src="jquery./jquery.dataTables.js"></script>
    	<script type="text/javascript" charset="utf-8">
    		$(document).ready(function() {
    		$('#example').dataTable();
    		} );
    	</script>	
    <style type="text/css" title="currentStyle">
    		@import "css/demo_page.css";
    		@import "css/demo_table.css";
    	</style>
     
    <?php echo '<meta http-equiv="refresh" content="60;url="UnAssignticket.php">';?>
    	  <style type="text/css">
    form {
        float:left;
    }
    </style>
    	</head>
     
    <body id="dt_example">
    <br/>
    <br/>
    <p>
    <table  BORDERCOLOR="#0B0B0B" border='1' bgcolor="#F5F5FA" width="100%"  align='center'>
    <tr>
    	<td >
    		<img src='img/pend.png'>
    	</td>
    </tr>
    <tr>
    	<td align='center'>
    		<div align='left' id="containerpend">
    			<div id="demo">
    				<table BORDERCOLOR="#0B0B0B"  frame="box" cellpadding="0" cellspacing="0" frame="box"  class="display" id="example"> 
     
    			<thead>
    				<tr>
    					<th><a title="Ticket Number">Ticket No.</a></th>
    					<th><a title="Ticket Create By">Create By</a></th>
    					<th><a title="Ticket Create Date">Create Date</a></th>
    					<th><a title="Date Assigned">Date Assigned</a></th>
    					<th><a title="Problem Error">Problem Description</a></th>
    					<th><a title="Ticket Assigned To">Assign To</a></th>
    					<th><a title="User Action">Action</a></th>
    				</tr>
    			</thead>
    			<tbody>			
    					<?php	foreach($pendtickets as $pendticket) 
     
    					{?>
     
    							<tr class="GradeA">
    								<td class='center'><?php echo "<a href='viewassignticket.php?id={$pendticket['TickNo']}&uname={$pendticket['UserName']}' title='View Ticket'>".$pendticket['TicketNo']."</a>"?></td>
    								<td class='center'><?php echo $pendticket['UserName'];?></td>
    								<td class='center'><?php echo $pendticket['DateCreate'];?></td>
    								<td class='center'><?php echo $pendticket['DateAssign'];?></td>
    								<td class='center'><?php echo $pendticket['Category']." (".$pendticket['Subcat'].")"?></td>
    								<td class='center'><?php echo $pendticket['AssignTo'];?></td>
    								<td class='center'>
     
    								<form   name='transfer'  action='forwardtick.php' method='POST' >
    								<?php 	$_SESSION['ticketassign']=$pendticket['TicketNo']; 
    										$_SESSION['nameassign']=$pendticket['AssignTo']; 
    								?>
    										<select  class='Trans' id='Trans' name='Trans' onchange="Transferticket('<?php echo $pendticket['TickNo'];?>',$(this));">
    											<option value="0">Please Select</option>
    											<?php foreach($AssignOptions as $TransferOption){ 
    											 if ($TransferOption['MISPIC'] != $pendticket['AssignTo'])	
    											echo '<option value="', $TransferOption['MISPIC'], '">', $TransferOption['MISPIC'], '</option>'; }	
     
    											?> 
    										</select>
     
    									</form>
    								</td>
     
    							</tr>
    					<?php }	?>
    						<?php foreach($newtickets as $newticket) { ?>
    							<tr class="GradeA">
    								<td class='center'><?php echo "<a href='ticketinfo.php?id={$newticket['TickNo']}' title='View Ticket'>".$newticket['TickNo']."</a>"?></td>
    								<td class='center'><?php echo $newticket['UserName'];?></td>
    								<td class='center'><?php echo $newticket['DateCreate'];?></td>
    								<td class='center'><?php echo $newticket['DateAssign'];?></td>
    								<td class='center'><?php echo $newticket['Category']." (".$newticket['Subcat'].")"?></td>
    								<td class='center'><?php echo $newticket['AssignTo'];?></td>
     
    								<td class='center'>
     
    									<form  id='assigned' name='assigned'  class='assigned'  action='asstoticket.php' method='POST'  >
    									<?php 	$_SESSION['assignticketno']=$newticket['TickNo']; ?>
    										<select style="width:100%" id='assignto' name='assignto' onchange="TicketAss('<?php echo $newticket['TickNo'];?>','<?php echo $newticket['UserName'];?>',$(this));" >
     
    											<option value="0">Please Select</option>
     
    											<?php foreach($AssignOptionsassignto as $TransferOptionassignto){ 
    											echo '<option  value="', $TransferOptionassignto['MISPIC'], '">', $TransferOptionassignto['MISPIC'], '</option>'; 
    										}
    											?> 
    										</select>
     
    									</form>
    								</td>
     
    							</tr>
    					<?php }	?>
    			</tbody>
    				<tfoot>
    					<th>Ticket No</th>
    					<th>Create By</th>
    					<th>Create Date</th>
    					<th>Date Assigned</th>
    					<th>Problem Description</th>
    					<th>Assign To</th>
    					<th>Action</th>	    
    			</tfoot>			
    		</table>
     
    			</div>
    		</div>
    	</td>	
    </tr>
    </table	>
    </p>
     
    <script type="text/javascript" charset="utf-8">
    function Transferticket(ticket,uVal) {
        if (window.confirm('Transfer this ticket number ' + ticket + ' to ' + uVal.val())) {
           	   document.forms['transfer'].submit();
     
    	}else{
    	uVal.val(0);
    	};
    }
    var trans = document.getElementsByTagName('transfer'),
        y;
    for (i = 0; y < trans.length; y += 1) {
        if (trans[y].className === 'transfer') {
            trans[y].onchange = Transferticket;
        }
    }
    </script>
     
    <script type="text/javascript" charset="utf-8">
     
    function TicketAss(ticketno,cname,sVal) {
        if (window.confirm('Assign this ticket number ' + ticketno + ' to ' + sVal.val())) {
           document.forms['assigned'].submit();
        }else{
    	sVal.val(0);
    	};
    }
    var ass = document.getElementsByTagName('assigned'),
        i;
    for (i = 0; i < ass.length; i += 1) {
        if (ass[i].className === 'assigned') {
            ass[i].onchange = TicketAss;
        }
    }
    </script>
     
     
     
    	</body>
    	</html>
    <?php
     
    }else{ //not logged in
        header('location: login.php');
    }
    ?>

  10. #10
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by ryoka012 View Post
    Sorry i can't give you a link..

    but here is the information
    Here is what the error said:"Object doesen't support this property or method"
    its on line 179
    and char 12
    What's on line 179?

    If you're using Internet Explorer, get some better info about the problem by going in to the advanced internet options, and enabling "Display a notification about every script error"
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  11. #11
    SitePoint Zealot
    Join Date
    Mar 2011
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It said on this syntax below

    Code JavaScript:
    document.forms['transfer'].submit();
    Object doesn't support this property or method

  12. #12
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by ryoka012 View Post
    It said on this syntax below

    Code JavaScript:
    document.forms['transfer'].submit();
    Object doesn't support this property or method
    Now work out what the problem is.

    Why is it that submit() is not a valid method of document.forms['transfer']
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  13. #13
    SitePoint Zealot
    Join Date
    Mar 2011
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    that's why i'am lost. read other forum it works fine for them but i dont get it to work..

    Can you help me..

  14. #14
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by ryoka012 View Post
    Can you help me..
    Can you post the HTML source of a web page that experiences the problem?
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  15. #15
    SitePoint Zealot
    Join Date
    Mar 2011
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is my complete source code.

    Code PHP:
    <?php
    session_start();
    if(isset($_SESSION['username'])){
    include_once("conn.php");
     
     
      $pendtickets = array();
      $newtickets=array();
         $selectTicketsQuery = mssql_query("Select * from tblTicket inner join tblAssign on tblTicket.TickNo=tblAssign.TicketNo and tblAssign .AssignTo!= '$_SESSION[username]' ");
         while($pendticket = mssql_fetch_array($selectTicketsQuery)){
            $pendtickets[] = $pendticket;
            }
        $newtickno=mssql_query("Select * from tblTicket where TickNo not in (select TicketNo from tblAssign)");
         while($newticket = mssql_fetch_array($newtickno)){
            $newtickets[] = $newticket;
            }
        $Assignto= mssql_query("Select * from MISPIC");
        while($AssignOptionassignto = mssql_fetch_array($Assignto)){
        $AssignOptionsassignto[] = $AssignOptionassignto;
        }
     
        $Assign= mssql_query("Select * from MISPIC ");
                                while($AssignOption = mssql_fetch_array($Assign)){
                                $AssignOptions[] = $AssignOption;
                                }
     
    ?>
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
     
        <script type="text/javascript" language="javascript" src="jquery./jquery.js"></script>
        <script type="text/javascript" language="javascript" src="jquery./jquery.dataTables.js"></script>
        <script type="text/javascript" charset="utf-8">
            $(document).ready(function() {
            $('#example').dataTable();
            } );
        </script>   
    <style type="text/css" title="currentStyle">
            @import "css/demo_page.css";
            @import "css/demo_table.css";
        </style>
     
    <?php echo '<meta http-equiv="refresh" content="60;url="UnAssignticket.php">';?>
          <style type="text/css">
    form {
        float:left;
    }
    </style>
        </head>
     
    <body id="dt_example">
    <br/>
    <br/>
    <p>
    <table  BORDERCOLOR="#0B0B0B" border='1' bgcolor="#F5F5FA" width="100%"  align='center'>
    <tr>
        <td >
            <img src='img/pend.png'>
        </td>
    </tr>
    <tr>
        <td align='center'>
            <div align='left' id="containerpend">
                <div id="demo">
                    <table BORDERCOLOR="#0B0B0B"  frame="box" cellpadding="0" cellspacing="0" frame="box"  class="display" id="example">
     
                <thead>
                    <tr>
                        <th><a title="Ticket Number">Ticket No.</a></th>
                        <th><a title="Ticket Create By">Create By</a></th>
                        <th><a title="Ticket Create Date">Create Date</a></th>
                        <th><a title="Date Assigned">Date Assigned</a></th>
                        <th><a title="Problem Error">Problem Description</a></th>
                        <th><a title="Ticket Assigned To">Assign To</a></th>
                        <th><a title="User Action">Action</a></th>
                    </tr>
                </thead>
                <tbody>   
                        <?php   foreach($pendtickets as $pendticket)
     
                        {?>
     
                                <tr class="GradeA">
                                    <td class='center'><?php echo "<a href='viewassignticket.php?id={$pendticket['TickNo']}&uname={$pendticket['UserName']}' title='View Ticket'>".$pendticket['TicketNo']."</a>"?></td>
                                    <td class='center'><?php echo $pendticket['UserName'];?></td>
                                    <td class='center'><?php echo $pendticket['DateCreate'];?></td>
                                    <td class='center'><?php echo $pendticket['DateAssign'];?></td>
                                    <td class='center'><?php echo $pendticket['Category']." (".$pendticket['Subcat'].")"?></td>
                                    <td class='center'><?php echo $pendticket['AssignTo'];?></td>
                                    <td class='center'>
     
                                    <form   name='transfer'  action='forwardtick.php' method='POST' >
                                    <?php   $_SESSION['ticketassign']=$pendticket['TicketNo'];
                                            $_SESSION['nameassign']=$pendticket['AssignTo'];
                                    ?>
                                            <select  class='Trans' id='Trans' name='Trans' onchange="Transferticket('<?php echo $pendticket['TickNo'];?>',$(this));">
                                                <option value="0">Please Select</option>
                                                <?php foreach($AssignOptions as $TransferOption){
                                                 if ($TransferOption['MISPIC'] != $pendticket['AssignTo']) 
                                                echo '<option value="', $TransferOption['MISPIC'], '">', $TransferOption['MISPIC'], '</option>'; } 
     
                                                ?>
                                            </select>
     
                                        </form>
                                    </td>
     
                                </tr>
                        <?php } ?>
                            <?php foreach($newtickets as $newticket) { ?>
                                <tr class="GradeA">
                                    <td class='center'><?php echo "<a href='ticketinfo.php?id={$newticket['TickNo']}' title='View Ticket'>".$newticket['TickNo']."</a>"?></td>
                                    <td class='center'><?php echo $newticket['UserName'];?></td>
                                    <td class='center'><?php echo $newticket['DateCreate'];?></td>
                                    <td class='center'><?php echo $newticket['DateAssign'];?></td>
                                    <td class='center'><?php echo $newticket['Category']." (".$newticket['Subcat'].")"?></td>
                                    <td class='center'><?php echo $newticket['AssignTo'];?></td>
     
                                    <td class='center'>
     
                                        <form  id='assigned' name='assigned'  class='assigned'  action='asstoticket.php' method='POST'  >
                                        <?php   $_SESSION['assignticketno']=$newticket['TickNo']; ?>
                                            <select style="width:100%" id='assignto' name='assignto' onchange="TicketAss('<?php echo $newticket['TickNo'];?>','<?php echo $newticket['UserName'];?>',$(this));" >
     
                                                <option value="0">Please Select</option>
     
                                                <?php foreach($AssignOptionsassignto as $TransferOptionassignto){
                                                echo '<option  value="', $TransferOptionassignto['MISPIC'], '">', $TransferOptionassignto['MISPIC'], '</option>';
                                            }
                                                ?>
                                            </select>
     
                                        </form>
                                    </td>
     
                                </tr>
                        <?php } ?>
                </tbody>
                    <tfoot>
                        <th>Ticket No</th>
                        <th>Create By</th>
                        <th>Create Date</th>
                        <th>Date Assigned</th>
                        <th>Problem Description</th>
                        <th>Assign To</th>
                        <th>Action</th>    
                </tfoot>           
            </table>
     
                </div>
            </div>
        </td>   
    </tr>
    </table >
    </p>
     
    <script type="text/javascript" charset="utf-8">
    function Transferticket(ticket,uVal) {
        if (window.confirm('Transfer this ticket number ' + ticket + ' to ' + uVal.val())) {
               document.forms['transfer'].submit();
     
        }else{
        uVal.val(0);
        };
    }
    var trans = document.getElementsByTagName('transfer'),
        y;
    for (i = 0; y < trans.length; y += 1) {
        if (trans[y].className === 'transfer') {
            trans[y].onchange = Transferticket;
        }
    }
    </script>
     
    <script type="text/javascript" charset="utf-8">
     
    function TicketAss(ticketno,cname,sVal) {
        if (window.confirm('Assign this ticket number ' + ticketno + ' to ' + sVal.val())) {
           document.forms['assigned'].submit();
        }else{
        sVal.val(0);
        };
    }
    var ass = document.getElementsByTagName('assigned'),
        i;
    for (i = 0; i < ass.length; i += 1) {
        if (ass[i].className === 'assigned') {
            ass[i].onchange = TicketAss;
        }
    }
    </script>
     
     
     
        </body>
        </html>
    <?php
     
    }else{ //not logged in
        header('location: login.php');
    }
    ?>

  16. #16
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by ryoka012 View Post
    This is my complete source code.
    JavaScript does not interact with PHP. It's the rendered HTML code that JavaScript works with, and it is within that same HTML code where your problem lies.

    All you have to do is to choose "View Source" after right-clicking on your web page. It's not that difficult.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  17. #17
    SitePoint Zealot
    Join Date
    Mar 2011
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry here is the Code.

    Code HTML4Strict:
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
     
        <script type="text/javascript" language="javascript" src="jquery./jquery.js"></script>
        <script type="text/javascript" language="javascript" src="jquery./jquery.dataTables.js"></script>
        <script type="text/javascript" charset="utf-8">
            $(document).ready(function() {
            $('#example').dataTable();
            } );
        </script>   
    <style type="text/css" title="currentStyle">
            @import "css/demo_page.css";
            @import "css/demo_table.css";
        </style>
     
    <meta http-equiv="refresh" content="60;url="UnAssignticket.php">      <style type="text/css">
    form {
        float:left;
    }
    </style>
        </head>
     
    <body id="dt_example">
    <br/>
    <br/>
    <p>
    <table  BORDERCOLOR="#0B0B0B" border='1' bgcolor="#F5F5FA" width="100%"  align='center'>
    <tr>
        <td >
            <img src='img/pend.png'>
        </td>
    </tr>
    <tr>
        <td align='center'>
            <div align='left' id="containerpend">
                <div id="demo">
                    <table BORDERCOLOR="#0B0B0B"  frame="box" cellpadding="0" cellspacing="0" frame="box"  class="display" id="example">
     
                <thead>
                    <tr>
                        <th><a title="Ticket Number">Ticket No.</a></th>
                        <th><a title="Ticket Create By">Create By</a></th>
                        <th><a title="Ticket Create Date">Create Date</a></th>
                        <th><a title="Date Assigned">Date Assigned</a></th>
                        <th><a title="Problem Error">Problem Description</a></th>
                        <th><a title="Ticket Assigned To">Assign To</a></th>
                        <th><a title="User Action">Action</a></th>
                    </tr>
                </thead>
                <tbody>   
     
                                <tr class="GradeA">
                                    <td class='center'><a href='viewassignticket.php?id=110520008&uname=User1' title='View Ticket'>110520008</a></td>
                                    <td class='center'>User1</td>
                                    <td class='center'>05/20/2011  2:36PM</td>
                                    <td class='center'>05/21/2011  6:28PM</td>
                                    <td class='center'>PC (Application)</td>
                                    <td class='center'>OliverG</td>
                                    <td class='center'>
     
                                    <form   name='transfer'  action='forwardtick.php' method='POST' >
                                                                            <select  class='Trans' id='Trans' name='Trans' onchange="Transferticket('110520008',$(this));">
                                                <option value="0">Please Select</option>
                                                <option value="JoshA">JoshA</option><option value="popo">popo</option><option value="Bert">Bert</option><option value="RiedB">RiedB</option><option value="ReidC">ReidC</option><option value="ReidD">ReidD</option><option value="ReidE">ReidE</option><option value="ReidF">ReidF</option><option value="ReidP">ReidP</option><option value="ReidZ">ReidZ</option><option value="ReidM">ReidM</option><option value="ReidJ">ReidJ</option>                                        </select>
     
                                        </form>
                                    </td>
     
                                </tr>
     
                                <tr class="GradeA">
                                    <td class='center'><a href='viewassignticket.php?id=110523001&uname=User1' title='View Ticket'>110523001 </a></td>
                                    <td class='center'>User1</td>
                                    <td class='center'>05/23/2011 11:58AM</td>
                                    <td class='center'>05/23/2011 11:59AM</td>
                                    <td class='center'>PC (Application)</td>
                                    <td class='center'>popo</td>
                                    <td class='center'>
     
                                    <form   name='transfer'  action='forwardtick.php' method='POST' >
                                                                            <select  class='Trans' id='Trans' name='Trans' onchange="Transferticket('110523001',$(this));">
                                                <option value="0">Please Select</option>
                                                <option value="JoshA">JoshA</option><option value="OliverG">OliverG</option><option value="Bert">Bert</option><option value="RiedB">RiedB</option><option value="ReidC">ReidC</option><option value="ReidD">ReidD</option><option value="ReidE">ReidE</option><option value="ReidF">ReidF</option><option value="ReidP">ReidP</option><option value="ReidZ">ReidZ</option><option value="ReidM">ReidM</option><option value="ReidJ">ReidJ</option>                                        </select>
     
                                        </form>
                                    </td>
     
                                </tr>
     
                                <tr class="GradeA">
                                    <td class='center'><a href='viewassignticket.php?id=110520005&uname=Weng1' title='View Ticket'>110520005</a></td>
                                    <td class='center'>Weng1</td>
                                    <td class='center'>05/20/2011 9:58AM</td>
                                    <td class='center'>May 20 2011  9:59AM</td>
                                    <td class='center'>PC (Application)</td>
                                    <td class='center'>popo</td>
                                    <td class='center'>
     
                                    <form   name='transfer'  action='forwardtick.php' method='POST' >
                                                                            <select  class='Trans' id='Trans' name='Trans' onchange="Transferticket('110520005',$(this));">
                                                <option value="0">Please Select</option>
                                                <option value="JoshA">JoshA</option><option value="OliverG">OliverG</option><option value="Bert">Bert</option><option value="RiedB">RiedB</option><option value="ReidC">ReidC</option><option value="ReidD">ReidD</option><option value="ReidE">ReidE</option><option value="ReidF">ReidF</option><option value="ReidP">ReidP</option><option value="ReidZ">ReidZ</option><option value="ReidM">ReidM</option><option value="ReidJ">ReidJ</option>                                        </select>
     
                                        </form>
                                    </td>
     
                                </tr>
     
                                <tr class="GradeA">
                                    <td class='center'><a href='viewassignticket.php?id=110520005&uname=Weng1' title='View Ticket'>110520005</a></td>
                                    <td class='center'>Weng1</td>
                                    <td class='center'>05/20/2011 9:58AM</td>
                                    <td class='center'>06/06/2011 12:47AM</td>
                                    <td class='center'>PC (Application)</td>
                                    <td class='center'>OliverG</td>
                                    <td class='center'>
     
                                    <form   name='transfer'  action='forwardtick.php' method='POST' >
                                                                            <select  class='Trans' id='Trans' name='Trans' onchange="Transferticket('110520005',$(this));">
                                                <option value="0">Please Select</option>
                                                <option value="JoshA">JoshA</option><option value="popo">popo</option><option value="Bert">Bert</option><option value="RiedB">RiedB</option><option value="ReidC">ReidC</option><option value="ReidD">ReidD</option><option value="ReidE">ReidE</option><option value="ReidF">ReidF</option><option value="ReidP">ReidP</option><option value="ReidZ">ReidZ</option><option value="ReidM">ReidM</option><option value="ReidJ">ReidJ</option>                                        </select>
     
                                        </form>
                                    </td>
     
                                </tr>
     
                                <tr class="GradeA">
                                    <td class='center'><a href='viewassignticket.php?id=110520006&uname=Weng' title='View Ticket'>110520006</a></td>
                                    <td class='center'>Weng</td>
                                    <td class='center'>05/20/201110:05AM</td>
                                    <td class='center'>06/06/2011 12:48AM</td>
                                    <td class='center'>PC (Application)</td>
                                    <td class='center'>OliverG</td>
                                    <td class='center'>
     
                                    <form   name='transfer'  action='forwardtick.php' method='POST' >
                                                                            <select  class='Trans' id='Trans' name='Trans' onchange="Transferticket('110520006',$(this));">
                                                <option value="0">Please Select</option>
                                                <option value="JoshA">JoshA</option><option value="popo">popo</option><option value="Bert">Bert</option><option value="RiedB">RiedB</option><option value="ReidC">ReidC</option><option value="ReidD">ReidD</option><option value="ReidE">ReidE</option><option value="ReidF">ReidF</option><option value="ReidP">ReidP</option><option value="ReidZ">ReidZ</option><option value="ReidM">ReidM</option><option value="ReidJ">ReidJ</option>                                        </select>
     
                                        </form>
                                    </td>
     
                                </tr>
     
                                <tr class="GradeA">
                                    <td class='center'><a href='viewassignticket.php?id=110520006&uname=Weng' title='View Ticket'>110520006</a></td>
                                    <td class='center'>Weng</td>
                                    <td class='center'>05/20/201110:05AM</td>
                                    <td class='center'>May 20 2011 10:06AM</td>
                                    <td class='center'>PC (Application)</td>
                                    <td class='center'>Bert</td>
                                    <td class='center'>
     
                                    <form   name='transfer'  action='forwardtick.php' method='POST' >
                                                                            <select  class='Trans' id='Trans' name='Trans' onchange="Transferticket('110520006',$(this));">
                                                <option value="0">Please Select</option>
                                                <option value="JoshA">JoshA</option><option value="popo">popo</option><option value="OliverG">OliverG</option><option value="RiedB">RiedB</option><option value="ReidC">ReidC</option><option value="ReidD">ReidD</option><option value="ReidE">ReidE</option><option value="ReidF">ReidF</option><option value="ReidP">ReidP</option><option value="ReidZ">ReidZ</option><option value="ReidM">ReidM</option><option value="ReidJ">ReidJ</option>                                        </select>
     
                                        </form>
                                    </td>
     
                                </tr>
     
                                <tr class="GradeA">
                                    <td class='center'><a href='viewassignticket.php?id=110520009&uname=User' title='View Ticket'>110520009</a></td>
                                    <td class='center'>User</td>
                                    <td class='center'>05/20/2011  3:34PM</td>
                                    <td class='center'>05/20/2011  5:31PM</td>
                                    <td class='center'>PC (Application)</td>
                                    <td class='center'>Admin</td>
                                    <td class='center'>
     
                                    <form   name='transfer'  action='forwardtick.php' method='POST' >
                                                                            <select  class='Trans' id='Trans' name='Trans' onchange="Transferticket('110520009',$(this));">
                                                <option value="0">Please Select</option>
                                                <option value="JoshA">JoshA</option><option value="popo">popo</option><option value="OliverG">OliverG</option><option value="Bert">Bert</option><option value="RiedB">RiedB</option><option value="ReidC">ReidC</option><option value="ReidD">ReidD</option><option value="ReidE">ReidE</option><option value="ReidF">ReidF</option><option value="ReidP">ReidP</option><option value="ReidZ">ReidZ</option><option value="ReidM">ReidM</option><option value="ReidJ">ReidJ</option>                                        </select>
     
                                        </form>
                                    </td>
     
                                </tr>
     
                                <tr class="GradeA">
                                    <td class='center'><a href='viewassignticket.php?id=110520011&uname=popo1' title='View Ticket'>110520011 </a></td>
                                    <td class='center'>popo1</td>
                                    <td class='center'>05/20/2011  3:38PM</td>
                                    <td class='center'>05/24/2011  3:18PM</td>
                                    <td class='center'>PC (Application)</td>
                                    <td class='center'>popo</td>
                                    <td class='center'>
     
                                    <form   name='transfer'  action='forwardtick.php' method='POST' >
                                                                            <select  class='Trans' id='Trans' name='Trans' onchange="Transferticket('110520011',$(this));">
                                                <option value="0">Please Select</option>
                                                <option value="JoshA">JoshA</option><option value="OliverG">OliverG</option><option value="Bert">Bert</option><option value="RiedB">RiedB</option><option value="ReidC">ReidC</option><option value="ReidD">ReidD</option><option value="ReidE">ReidE</option><option value="ReidF">ReidF</option><option value="ReidP">ReidP</option><option value="ReidZ">ReidZ</option><option value="ReidM">ReidM</option><option value="ReidJ">ReidJ</option>                                        </select>
     
                                        </form>
                                    </td>
     
                                </tr>
     
                                <tr class="GradeA">
                                    <td class='center'><a href='viewassignticket.php?id=110520012&uname=Weng1' title='View Ticket'>110520012 </a></td>
                                    <td class='center'>Weng1</td>
                                    <td class='center'>05/20/2011  3:38PM</td>
                                    <td class='center'>05/23/2011 11:46AM</td>
                                    <td class='center'>PC (Application)</td>
                                    <td class='center'>popo</td>
                                    <td class='center'>
     
                                    <form   name='transfer'  action='forwardtick.php' method='POST' >
                                                                            <select  class='Trans' id='Trans' name='Trans' onchange="Transferticket('110520012',$(this));">
                                                <option value="0">Please Select</option>
                                                <option value="JoshA">JoshA</option><option value="OliverG">OliverG</option><option value="Bert">Bert</option><option value="RiedB">RiedB</option><option value="ReidC">ReidC</option><option value="ReidD">ReidD</option><option value="ReidE">ReidE</option><option value="ReidF">ReidF</option><option value="ReidP">ReidP</option><option value="ReidZ">ReidZ</option><option value="ReidM">ReidM</option><option value="ReidJ">ReidJ</option>                                        </select>
     
                                        </form>
                                    </td>
     
                                </tr>
     
                                <tr class="GradeA">
                                    <td class='center'><a href='viewassignticket.php?id=110520013&uname=popo1' title='View Ticket'>110520013 </a></td>
                                    <td class='center'>popo1</td>
                                    <td class='center'>05/20/2011  3:40PM</td>
                                    <td class='center'>05/24/2011  3:21PM</td>
                                    <td class='center'>PC (Application)</td>
                                    <td class='center'>OliverG</td>
                                    <td class='center'>
     
                                    <form   name='transfer'  action='forwardtick.php' method='POST' >
                                                                            <select  class='Trans' id='Trans' name='Trans' onchange="Transferticket('110520013',$(this));">
                                                <option value="0">Please Select</option>
                                                <option value="JoshA">JoshA</option><option value="popo">popo</option><option value="Bert">Bert</option><option value="RiedB">RiedB</option><option value="ReidC">ReidC</option><option value="ReidD">ReidD</option><option value="ReidE">ReidE</option><option value="ReidF">ReidF</option><option value="ReidP">ReidP</option><option value="ReidZ">ReidZ</option><option value="ReidM">ReidM</option><option value="ReidJ">ReidJ</option>                                        </select>
     
                                        </form>
                                    </td>
     
                                </tr>
     
                                <tr class="GradeA">
                                    <td class='center'><a href='viewassignticket.php?id=110520014&uname=Weng' title='View Ticket'>110520014</a></td>
                                    <td class='center'>Weng</td>
                                    <td class='center'>05/20/2011  3:40PM</td>
                                    <td class='center'>06/06/2011  1:13AM</td>
                                    <td class='center'>PC (Application)</td>
                                    <td class='center'>OliverG</td>
                                    <td class='center'>
     
                                    <form   name='transfer'  action='forwardtick.php' method='POST' >
                                                                            <select  class='Trans' id='Trans' name='Trans' onchange="Transferticket('110520014',$(this));">
                                                <option value="0">Please Select</option>
                                                <option value="JoshA">JoshA</option><option value="popo">popo</option><option value="Bert">Bert</option><option value="RiedB">RiedB</option><option value="ReidC">ReidC</option><option value="ReidD">ReidD</option><option value="ReidE">ReidE</option><option value="ReidF">ReidF</option><option value="ReidP">ReidP</option><option value="ReidZ">ReidZ</option><option value="ReidM">ReidM</option><option value="ReidJ">ReidJ</option>                                        </select>
     
                                        </form>
                                    </td>
     
                                </tr>
                                                                            <tr class="GradeA">
                                    <td class='center'><a href='ticketinfo.php?id=110523004' title='View Ticket'>110523004</a></td>
                                    <td class='center'>Weng1</td>
                                    <td class='center'>05/23/2011  4:37PM</td>
                                    <td class='center'></td>
                                    <td class='center'>PC (Application)</td>
                                    <td class='center'></td>
     
                                    <td class='center'>
     
                                        <form  id='assigned' name='assigned'  class='assigned'  action='asstoticket.php' method='POST'  >
                                                                                <select style="width:100%" id='assignto' name='assignto' onchange="TicketAss('110523004','Weng1',$(this));" >
     
                                                <option value="0">Please Select</option>
     
                                                <option  value="JoshA">JoshA</option><option  value="popo">popo</option><option  value="OliverG">OliverG</option><option  value="Bert">Bert</option><option  value="RiedB">RiedB</option><option  value="ReidC">ReidC</option><option  value="ReidD">ReidD</option><option  value="ReidE">ReidE</option><option  value="ReidF">ReidF</option><option  value="ReidP">ReidP</option><option  value="ReidZ">ReidZ</option><option  value="ReidM">ReidM</option><option  value="ReidJ">ReidJ</option>                                        </select>
     
                                        </form>
                                    </td>
     
                                </tr>
                                                    <tr class="GradeA">
                                    <td class='center'><a href='ticketinfo.php?id=110524001' title='View Ticket'>110524001</a></td>
                                    <td class='center'>Weng1</td>
                                    <td class='center'>05/24/2011 10:26AM</td>
                                    <td class='center'></td>
                                    <td class='center'>PC (Application)</td>
                                    <td class='center'></td>
     
                                    <td class='center'>
     
                                        <form  id='assigned' name='assigned'  class='assigned'  action='asstoticket.php' method='POST'  >
                                                                                <select style="width:100%" id='assignto' name='assignto' onchange="TicketAss('110524001','Weng1',$(this));" >
     
                                                <option value="0">Please Select</option>
     
                                                <option  value="JoshA">JoshA</option><option  value="popo">popo</option><option  value="OliverG">OliverG</option><option  value="Bert">Bert</option><option  value="RiedB">RiedB</option><option  value="ReidC">ReidC</option><option  value="ReidD">ReidD</option><option  value="ReidE">ReidE</option><option  value="ReidF">ReidF</option><option  value="ReidP">ReidP</option><option  value="ReidZ">ReidZ</option><option  value="ReidM">ReidM</option><option  value="ReidJ">ReidJ</option>                                        </select>
     
                                        </form>
                                    </td>
     
                                </tr>
                                                    <tr class="GradeA">
                                    <td class='center'><a href='ticketinfo.php?id=110524002' title='View Ticket'>110524002</a></td>
                                    <td class='center'>User1</td>
                                    <td class='center'>05/24/2011  2:21PM</td>
                                    <td class='center'></td>
                                    <td class='center'>PC (Application)</td>
                                    <td class='center'></td>
     
                                    <td class='center'>
     
                                        <form  id='assigned' name='assigned'  class='assigned'  action='asstoticket.php' method='POST'  >
                                                                                <select style="width:100%" id='assignto' name='assignto' onchange="TicketAss('110524002','User1',$(this));" >
     
                                                <option value="0">Please Select</option>
     
                                                <option  value="JoshA">JoshA</option><option  value="popo">popo</option><option  value="OliverG">OliverG</option><option  value="Bert">Bert</option><option  value="RiedB">RiedB</option><option  value="ReidC">ReidC</option><option  value="ReidD">ReidD</option><option  value="ReidE">ReidE</option><option  value="ReidF">ReidF</option><option  value="ReidP">ReidP</option><option  value="ReidZ">ReidZ</option><option  value="ReidM">ReidM</option><option  value="ReidJ">ReidJ</option>                                        </select>
     
                                        </form>
                                    </td>
     
                                </tr>
                                                    <tr class="GradeA">
                                    <td class='center'><a href='ticketinfo.php?id=110524003' title='View Ticket'>110524003</a></td>
                                    <td class='center'>User1</td>
                                    <td class='center'>05/24/2011  2:23PM</td>
                                    <td class='center'></td>
                                    <td class='center'>PC (Application)</td>
                                    <td class='center'></td>
     
                                    <td class='center'>
     
                                        <form  id='assigned' name='assigned'  class='assigned'  action='asstoticket.php' method='POST'  >
                                                                                <select style="width:100%" id='assignto' name='assignto' onchange="TicketAss('110524003','User1',$(this));" >
     
                                                <option value="0">Please Select</option>
     
                                                <option  value="JoshA">JoshA</option><option  value="popo">popo</option><option  value="OliverG">OliverG</option><option  value="Bert">Bert</option><option  value="RiedB">RiedB</option><option  value="ReidC">ReidC</option><option  value="ReidD">ReidD</option><option  value="ReidE">ReidE</option><option  value="ReidF">ReidF</option><option  value="ReidP">ReidP</option><option  value="ReidZ">ReidZ</option><option  value="ReidM">ReidM</option><option  value="ReidJ">ReidJ</option>                                        </select>
     
                                        </form>
                                    </td>
     
                                </tr>
                                                    <tr class="GradeA">
                                    <td class='center'><a href='ticketinfo.php?id=110524004' title='View Ticket'>110524004</a></td>
                                    <td class='center'>User1</td>
                                    <td class='center'>05/24/2011  2:23PM</td>
                                    <td class='center'></td>
                                    <td class='center'>PC (Application)</td>
                                    <td class='center'></td>
     
                                    <td class='center'>
     
                                        <form  id='assigned' name='assigned'  class='assigned'  action='asstoticket.php' method='POST'  >
                                                                                <select style="width:100%" id='assignto' name='assignto' onchange="TicketAss('110524004','User1',$(this));" >
     
                                                <option value="0">Please Select</option>
     
                                                <option  value="JoshA">JoshA</option><option  value="popo">popo</option><option  value="OliverG">OliverG</option><option  value="Bert">Bert</option><option  value="RiedB">RiedB</option><option  value="ReidC">ReidC</option><option  value="ReidD">ReidD</option><option  value="ReidE">ReidE</option><option  value="ReidF">ReidF</option><option  value="ReidP">ReidP</option><option  value="ReidZ">ReidZ</option><option  value="ReidM">ReidM</option><option  value="ReidJ">ReidJ</option>                                        </select>
     
                                        </form>
                                    </td>
     
                                </tr>
                                                    <tr class="GradeA">
                                    <td class='center'><a href='ticketinfo.php?id=110524005' title='View Ticket'>110524005</a></td>
                                    <td class='center'>User</td>
                                    <td class='center'>05/24/2011  2:25PM</td>
                                    <td class='center'></td>
                                    <td class='center'>PC (Application)</td>
                                    <td class='center'></td>
     
                                    <td class='center'>
     
                                        <form  id='assigned' name='assigned'  class='assigned'  action='asstoticket.php' method='POST'  >
                                                                                <select style="width:100%" id='assignto' name='assignto' onchange="TicketAss('110524005','User',$(this));" >
     
                                                <option value="0">Please Select</option>
     
                                                <option  value="JoshA">JoshA</option><option  value="popo">popo</option><option  value="OliverG">OliverG</option><option  value="Bert">Bert</option><option  value="RiedB">RiedB</option><option  value="ReidC">ReidC</option><option  value="ReidD">ReidD</option><option  value="ReidE">ReidE</option><option  value="ReidF">ReidF</option><option  value="ReidP">ReidP</option><option  value="ReidZ">ReidZ</option><option  value="ReidM">ReidM</option><option  value="ReidJ">ReidJ</option>                                        </select>
     
                                        </form>
                                    </td>
     
                                </tr>
                                                    <tr class="GradeA">
                                    <td class='center'><a href='ticketinfo.php?id=110524006' title='View Ticket'>110524006</a></td>
                                    <td class='center'>Weng</td>
                                    <td class='center'>05/24/2011  2:26PM</td>
                                    <td class='center'></td>
                                    <td class='center'>PC (Application)</td>
                                    <td class='center'></td>
     
                                    <td class='center'>
     
                                        <form  id='assigned' name='assigned'  class='assigned'  action='asstoticket.php' method='POST'  >
                                                                                <select style="width:100%" id='assignto' name='assignto' onchange="TicketAss('110524006','Weng',$(this));" >
     
                                                <option value="0">Please Select</option>
     
                                                <option  value="JoshA">JoshA</option><option  value="popo">popo</option><option  value="OliverG">OliverG</option><option  value="Bert">Bert</option><option  value="RiedB">RiedB</option><option  value="ReidC">ReidC</option><option  value="ReidD">ReidD</option><option  value="ReidE">ReidE</option><option  value="ReidF">ReidF</option><option  value="ReidP">ReidP</option><option  value="ReidZ">ReidZ</option><option  value="ReidM">ReidM</option><option  value="ReidJ">ReidJ</option>                                        </select>
     
                                        </form>
                                    </td>
     
                                </tr>
                                                    <tr class="GradeA">
                                    <td class='center'><a href='ticketinfo.php?id=110524007' title='View Ticket'>110524007</a></td>
                                    <td class='center'>User</td>
                                    <td class='center'>05/24/2011  2:27PM</td>
                                    <td class='center'></td>
                                    <td class='center'>PC (Application)</td>
                                    <td class='center'></td>
     
                                    <td class='center'>
     
                                        <form  id='assigned' name='assigned'  class='assigned'  action='asstoticket.php' method='POST'  >
                                                                                <select style="width:100%" id='assignto' name='assignto' onchange="TicketAss('110524007','User',$(this));" >
     
                                                <option value="0">Please Select</option>
     
                                                <option  value="JoshA">JoshA</option><option  value="popo">popo</option><option  value="OliverG">OliverG</option><option  value="Bert">Bert</option><option  value="RiedB">RiedB</option><option  value="ReidC">ReidC</option><option  value="ReidD">ReidD</option><option  value="ReidE">ReidE</option><option  value="ReidF">ReidF</option><option  value="ReidP">ReidP</option><option  value="ReidZ">ReidZ</option><option  value="ReidM">ReidM</option><option  value="ReidJ">ReidJ</option>                                        </select>
     
                                        </form>
                                    </td>
     
                                </tr>
                                    </tbody>
                    <tfoot>
                        <th>Ticket No</th>
                        <th>Create By</th>
                        <th>Create Date</th>
                        <th>Date Assigned</th>
                        <th>Problem Description</th>
                        <th>Assign To</th>
                        <th>Action</th>   
                </tfoot>           
            </table>
     
                </div>
            </div>
        </td>   
    </tr>
    </table >
    </p>
     
    <script type="text/javascript" charset="utf-8">
    function Transferticket(ticket,uVal) {
        if (window.confirm('Transfer this ticket number ' + ticket + ' to ' + uVal.val())) {
               document.forms['transfer'].submit();
     
        }else{
        uVal.val(0);
        };
    }
    var trans = document.getElementsByTagName('transfer'),
        y;
    for (i = 0; y < trans.length; y += 1) {
        if (trans[y].className === 'transfer') {
            trans[y].onchange = Transferticket;
        }
    }
    </script>
     
    <script type="text/javascript" charset="utf-8">
     
    function TicketAss(ticketno,cname,sVal) {
        if (window.confirm('Assign this ticket number ' + ticketno + ' to ' + sVal.val())) {
           document.forms['assigned'].submit();
        }else{
        sVal.val(0);
        };
    }
    var ass = document.getElementsByTagName('assigned'),
        i;
    for (i = 0; i < ass.length; i += 1) {
        if (ass[i].className === 'assigned') {
            ass[i].onchange = TicketAss;
        }
    }
    </script>
     
     
     
        </body>
        </html>

  18. #18
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    4 Thread(s)
    What steps must be performed on the page for the error to occur? Currently I'm getting no error in IE8 or IE9
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  19. #19
    SitePoint Zealot
    Join Date
    Mar 2011
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The next page will viewed the information of the ticket number..
    is it the same error?
    Thanks for the help.

  20. #20
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by ryoka012 View Post
    The next page will viewed the information of the ticket number..
    is it the same error?
    Thanks for the help.
    So does the error occur on the page with the HTML code that you provided, or on some other next page?

    Normally, such problems are best resolved by linking us through to a test page where we can experience the same problem that you experience, so that once the actual problem can be experienced, we can diagnose an appropriate solution to apply.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  21. #21
    SitePoint Zealot
    Join Date
    Mar 2011
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    within the same page that i provided..i don't have a access to give you for the link.sorry.

  22. #22
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by ryoka012 View Post
    within the same page that i provided..i don't have a access to give you for the link.sorry.
    Well currently when clicking on the ticket number, it tries to load a new page. Is that how your problem is experienced, and is it expected for the ticket number to try and load a new page?
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  23. #23
    SitePoint Zealot
    Join Date
    Mar 2011
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    my problem lies in the dropdown box..
    will give you the next page if it is successful..

    Code HTML4Strict:
    <html>
    <head>
    	<script src="jquery/jquery.min.js"></script>
    	<script type="text/javascript" src="jquery/jquery.validate.js"></script> 
    	<script>
    		$(document).ready(function(){
    			$.validator.addMethod("noSpecialChars", function(value, element) {
    				  return this.optional(element) || /^[a-z0-9\_]+$/i.test(value);
    			  }, "<br/><font size='3' color='#FF0000'>Username must contain only letters, numbers, or underscore.</font>");
    			$("#msg").validate({
    			  rules: {
    			  description:"required",
    				severity:"required"
     
    			 }
    			});
    		});
    	</script>
    <script>
    function textCounter(field, countfield, maxlimit)
    {
      if (field.value.length > maxlimit)
        field.value = field.value.substring(0, maxlimit);
      else 
        countfield.value = maxlimit - field.value.length;
    }
    function textcount(field,mlimit)
    {
      field.value = field.value.substring(0, mlimit);
    }
    </script>
    	<style>
    .Wordwrap
     
    {
    width: 300px;
    white-space: pre-wrap; /* css-3 */
    white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
    white-space: -pre-wrap; /* Opera 4-6 */
    white-space: -o-pre-wrap; /* Opera 7 */
    word-wrap: break-word; /* Internet Explorer 5.5+ */
     
    }
    </style>
    </head>
    <body onload="document.msg.description.focus();">
     
    <table  BORDERCOLOR="#0B0B0B" border='1' bgcolor="#F5F5FA" width="80%"  align='center'>
    <tr>
    	<td width="100%" align="left" valign="middle">
    	<img src='img/assignto.png'>
    	</td>
    </tr>
     
    <td width="100%" align="center" >
    <table align='center' BORDERCOLOR="#0B0B0B">
    <form  name='msg' id='msg' action='asstoticket.php' method='post'  enctype="multipart/form-data">
    	<table  align='center'>
     
    	<input type='hidden' value='JoshA' name='assto'>
    	<input type='hidden' value='User' name='cby'>
     
    		<tr>
    			<td><strong><label>Ticket No : </label></strong>110622004	</td>	
    		</tr>
    		<tr>
    			<td><strong><label>Create By : </label></strong>User	</td>
    			<td><b>Assign to : </b>JoshA</td>			
    		</tr>
    		<tr>
    			<td><strong>Date Create : </strong>06/22/2011  4:21PM</td>
    			<td><strong>Date to be Assign: </strong>2011-06-27</td>
    		<tr>
    		<tr>		
    			<td><strong>Category : </strong>PC</td>
    			<td><strong>Sub-Category : </strong>Application</td>
    		</tr>
    		<tr>
    			<td>
    				<strong>File Attachment : </strong>
    							</td>
    		<td><b>Severity :</b> </td>		
    		</tr>
     
    		<tr><td class='Wordwrap'><strong>Description : </strong>my sampoke</td></tr>	
     
    <tr><td align='left'><b>Attach File :</b><br/><input size='10' align='left'  type='file' name='images'>Max File Size 2mb</td></tr>
    <br/>
    <table class='main' width='50%' BORDERCOLOR="#0B0B0B" align="center" frame='Box'>
    <br/>
    <b>Messages:</b>
    <tr>
    	<td colspan="4">
    		   <div style="height: 200px; overflow: auto; border: 1px solid black;">
    				</div>
    	</td>
     
    </tr>
    </table>
    <table  align='center'>
    <tr>
    	<td>
    	<tr>
    	<td align='left'><b>Comment's/Solution <font color=red>*</font> :</td>
    	</tr>
    	<tr>
    		<td align='left'><textarea rows="7" cols="50" name="description" onKeyDown="textCounter(this.form.description,this.form.remLen,500);" onKeyUp="textCounter(this.form.description,this.form.remLen,500);" >
    		</textarea><br><input readonly type=text name=remLen size=3 maxlength=3 value="500"> characters left.</font></td>
    	</tr>
     
    	<tr>
    	<td align='left'>
    		<input type='submit' value='Submit' name='Save'  onClick="javascript: var x=window.confirm('Assign this ticket to JoshA?');if (!x) return(false);" title='Submit a Message'>
    		<input type='Reset' value='Reset' name='reset' title='Reset'>
    	</td>
    	</tr>
    </td>	
    </tr>	
    	</table>
     
    </form>
     
    <br/>
    </tr>
    </td>
    </table>	
    </body>
    </html>

  24. #24
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by ryoka012 View Post
    my problem lies in the dropdown box..
    will give you the next page if it is successful..
    Thanks. The problem is that this code expect one form element with a name of "transfer"

    Code:
    document.forms['transfer'].submit();
    but the page contains many different forms with a name of "transfer". Each of those Action dropdowns is a separate and different form with the name of "transfer", so JavaScript returns a nodelist that contains multiple forms.

    The good news is that you have used the standard event association technique to associate the function to the forms.

    Code javascript:
    trans[y].onchange = Transferticket;

    That's good, because the Transferticket function will be invoked with the this keyword referring to the element that triggered the event, which just-so-happens to be the form that you're after.

    So, instead of that documents.forms['transfer'] code, you should be able to instead use the this keyword to trigger the submit event for the appropriate form:

    Code javascript:
    this.submit();
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  25. #25
    SitePoint Zealot
    Join Date
    Mar 2011
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I have change my code documents.forms['transfer'] to this.submit(); but still the old error appear on the browser "Object doesn't support this property or method"


Bookmarks

Posting Permissions

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