I want to display this
http://www.bwbsv.de/bbsb/service/extern/standings.php?start=http://www.bwbsv.de/bbsb/service/extern/start.htm&end=http://www.bwbsv.de/bbsb/service/extern/end.htm&t=401
(this is just an example)
on a page of my wordpress site.
The start.htm contains
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="de" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Demonstration Tabellen-Integration</title>
<link rel="stylesheet" type="text/css"
href="http://www.bwbsv.de/bbsb/service/extern/demo.css" />
</head>
<body>
while the end.htm looks like
</body>
</html>
The "t=401" specifies what league to display.
What would be the best way to implement this into a page?
EDIT: I forgot somehing. The url of the start.htm and end.htm are stored localy while the standings.php isn't. the point of this is to have an up to date league table, whithout doing it manually.
EDIT 2: To clarify further:
The first link is just an example of how it should look like. It can be customized to fit the users needs with for example t=401 means the league with id=401. After customization it should look something like this
http://www.bwbsv.de/bbsb/service/extern/standings.php?start=http:/yourServer.com/start.htm&end=http://http:/yourServer.com/end.htm&t=123
This link provides an up to date league table of the league with id 123. The updates are not done by me, they are provided from the bwbsv page. I want to integrate this table into an normal page/widget/sidebar/... on my wordpress site.
As I mentioned in my first post, due to the Same origin policy you cant load external content, sorry.
Use jQuery load()
Give the table an id of league-table and then:
$('#league-table').load('path/to/your_file');
Here is a working example:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="de" xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<title>Demonstration Tabellen-Integration</title>
<link rel="stylesheet" type="text/css"
href="http://www.bwbsv.de/bbsb/service/extern/demo.css" />
</head>
<body>
<script type="text/javascript">
console.log("here");
$(document).ready(function(){
console.log("here");
$('#league').load('path_to_your_file.html');
alert("finished loading");
});
</script>
<div id="league">
</div>
</body>
</html>
File.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="de" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Demonstration Tabellen-Integration</title>
<link rel="stylesheet" type="text/css"
href="http://www.bwbsv.de/bbsb/service/extern/demo.css" />
</head>
<body>
<table id="league" class="standings">
<tbody><tr>
<th class="hpl">Pl.</th>
<th class="hteam">Team</th>
<th class="hg">G</th>
<th class="hv">V</th>
<th class="hpct">.pct</th>
<th class="hgb">GB</th>
</tr>
<tr>
<td class="pl">1.</td>
<td class="team">
Kehl Mosquitos
</td>
<td class="g">0</td>
<td class="v">0</td>
<td class="pct">.000</td>
<td class="gb">0</td>
</tr>
<tr>
<td class="pl">2.</td>
<td class="team">
Ulm Falcons
</td>
<td class="g">0</td>
<td class="v">0</td>
<td class="pct">.000</td>
<td class="gb">0</td>
</tr>
<tr>
<td class="pl">3.</td>
<td class="team">
Sindelfingen Squirrels
</td>
<td class="g">0</td>
<td class="v">0</td>
<td class="pct">.000</td>
<td class="gb">0</td>
</tr>
<tr>
<td class="pl">4.</td>
<td class="team">
Heidelberg Hedgehogs
</td>
<td class="g">0</td>
<td class="v">0</td>
<td class="pct">.000</td>
<td class="gb">0</td>
</tr>
<tr>
<td class="pl">5.</td>
<td class="team">
Schriesheim Raubritter
</td>
<td class="g">0</td>
<td class="v">0</td>
<td class="pct">.000</td>
<td class="gb">0</td>
</tr>
<tr>
<td class="pl">6.</td>
<td class="team">
Göppingen Green Sox
</td>
<td class="g">0</td>
<td class="v">0</td>
<td class="pct">.000</td>
<td class="gb">0</td>
</tr>
<tr>
<td class="pl">7.</td>
<td class="team">
Freiburg Knights
</td>
<td class="g">0</td>
<td class="v">0</td>
<td class="pct">.000</td>
<td class="gb">0</td>
</tr>
<tr>
<td class="pl">8.</td>
<td class="team">
Tübingen Hawks 2
</td>
<td class="g">0</td>
<td class="v">0</td>
<td class="pct">.000</td>
<td class="gb">0</td>
</tr>
<tr>
<td class="pl">9.</td>
<td class="team">
Neuenburg Atomics 2
</td>
<td class="g">0</td>
<td class="v">0</td>
<td class="pct">.000</td>
<td class="gb">0</td>
</tr>
</tbody></table>
</body>
</html>
Try with adding an iframe:
<iframe border="0" width="600px" height="auto" src="http://www.bwbsv.de/bbsb/service/extern/standings.php?start=http://www.bwbsv.de/bbsb/service/extern/start.htm&end=http://www.bwbsv.de/bbsb/service/extern/end.htm&t=401"></iframe>
You can change it's dimension for the best fit of the page.
Related
The following:
Frame not found in cellmap
https://github.com/dompdf/dompdf/issues/657
Is a well know problem on the internet. But I can't find a solution
for the problem. I'm trying to convert my html template to pdf. When I remove the <table> it's working. Otherwise it throws an exception.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Example 2</title>
<link rel="stylesheet" href="/administration/style.css" media="all" />
</head>
<body>
<header class="clearfix">
<div id="logo">
<img src="/administration/logo.png">
</div>
<div id="company">
<h2 class="name">Company Name</h2>
<div>455 Foggy Heights, AZ 85004, US</div>
<div>(602) 519-0450</div>
<div>company#example.com</div>
</div>
</div>
</header>
<main>
<div id="details" class="clearfix">
<div id="client">
<div class="to">INVOICE TO:</div>
<h2 class="name">John Doe</h2>
<div class="address">796 Silver Harbour, TX 79273, US</div>
<div class="email">john#example.com</div>
</div>
<div id="invoice">
<h1>INVOICE 3-2-1</h1>
<div class="date">Date of Invoice: 01/06/2014</div>
<div class="date">Due Date: 30/06/2014</div>
</div>
</div>
<table border="0" cellspacing="0" cellpadding="0">
<thead>
<tr>
<th class="no">#</th>
<th class="desc">DESCRIPTION</th>
<th class="unit">UNIT PRICE</th>
<th class="qty">QUANTITY</th>
<th class="total">TOTAL</th>
</tr>
</thead>
<tbody>
<tr>
<td class="no">01</td>
<td class="desc"><h3>Website Design</h3>Creating a recognizable design solution based on the company's existing visual identity</td>
<td class="unit">$40.00</td>
<td class="qty">30</td>
<td class="total">$1,200.00</td>
</tr>
<tr>
<td class="no">02</td>
<td class="desc"><h3>Website Development</h3>Developing a Content Management System-based Website</td>
<td class="unit">$40.00</td>
<td class="qty">80</td>
<td class="total">$3,200.00</td>
</tr>
<tr>
<td class="no">03</td>
<td class="desc"><h3>Search Engines Optimization</h3>Optimize the site for search engines (SEO)</td>
<td class="unit">$40.00</td>
<td class="qty">20</td>
<td class="total">$800.00</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="1"></td>
<td colspan="1">SUBTOTAL</td>
<td>$5,200.00</td>
</tr>
<tr>
<td colspan="1"></td>
<td colspan="1">TAX 25%</td>
<td>$1,300.00</td>
</tr>
<tr>
<td colspan="1"></td>
<td colspan="1">GRAND TOTAL</td>
<td>$6,500.00</td>
</tr>
</tfoot>
</table>
<div id="thanks">Thank you!</div>
<div id="notices">
<div>NOTICE:</div>
<div class="notice">A finance charge of 1.5% will be made on unpaid balances after 30 days.</div>
</div>
</main>
<footer>
Invoice was created on a computer and is valid without the signature and seal.
</footer>
</body>
</html>
I had a similar problem, but was able to discover that I had an extra < in one of my text items (the text was entered by a user, so they had an age question that was like Are you < 21 years old. Make sure you escape these (in PHP, use htmlentities).
This can also happen with invalid html or an extra HTML tag. I looked through your <table> above and ran it through dompdf, but it didn't throw the error, so perhaps you had an errant < in your code that was not copied to StackOverflow?
SOLUTION:
use this:
$orientation = 'landscape';
$customPaper = array(0,0,950,950);
$this->setPaper($customPaper, $orientation);
I'm trying to send an HTML formatted invoice but it is sending the message as plain text rather than formatted HTML.
The code is:
$this->load->library('email',$config);
$this->email->set_newline("\r\n");
$this->email->from('sample#email.com', 'Sample');
$this->email->to('sample2#email.com');
$this->email->cc('sample3#email.com');
$this->email->subject('Sample Test');
$this->email->message($message);
$this->email->send();
echo $this->email->print_debugger();
and the content:
$message ='
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<style>
<![CDATA[
body, td { color:#a6a7a3; font-size: 14px; font-family:Arial; font-weight:normal; text-decoration:none; }
a { color:#a6a7a3; font-weight:normal; text-decoration:none; }
table td { border-collapse: collapse;}
]]>
</style>
</head>
<body>
<table>
<tr>
<td>
<table>
<tr>
<td>
<!-- // Begin Template Header \ -->
<table>
<tr>
<td><!--IMAGE--></td>
</tr>
</table><!-- // End Template Header \ -->
</td>
</tr>
<tr>
<td>
<!-- // Begin Template Body \ -->
<table>
<tr>
<td>
<!-- // Begin Module: Standard Content \ -->
<table>
<tr>
<td>
<div>
<strong style="font-size:14px;font-family:Arial;">Dear Sample,</strong><br />
<br />
Thank you for being with us. <!-- Start Transaction Information -->
<table>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td><strong>Sample</strong></td>
</tr>
</table>
<table>
<tr>
<td></td>
</tr>
<tr>
<td>Item Name</td>
<td>Quantity</td>
<td>Item Price</td>
<td>Item Code</td>
<td>Shipping</td>
</tr>
<tr>
<td>'.$item.'</td>
<td>'.$quantity.'</td>
<td>'.$price.'</td>
<td>'.$code.'</td>
<td>'.$shipping.'</td>
</tr>
</table><!-- End Transaction Information -->
</div>
</td>
</tr>
</table><!-- // End Module: Standard Content \ -->
</td>
</tr>
</table><!-- // End Template Body \ -->
</td>
</tr>
</table><br />
</td>
</tr>
</table><br />
</body>
</html>';
$this->email->set_mailtype("html");
Here you might also find this useful.. I was bored. You'll get much better device compatibility with this code..
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta content="telephone=no" name="format-detection" /><!-- ios -->
<meta content="on" http-equiv="cleartype" /><!-- Internet explorer -->
<style>
<![CDATA[
html,body,.ReadMsgBody, .ExternalClass,.ExternalClass * { background-color:#ffffff;width:100%!important;line-height:100%;margin:0;-webkit-text-size-adjust:100%; }
table,table td { border-collapse:collapse;mso-table-lspace:0pt;mso-table-rspace:0pt; }
img { display:block;border:0 none;outline:none;height:auto;line-height:100%;margin:0;padding:0;text-decoration:none;-ms-interpolation-mode:bicubic; }
.container { width:600px; }
#outlook a { padding:0; }
.yshortcuts,.yshortcuts a,.yshortcuts a:link,.yshortcuts a:visited,.yshortcuts a:hover,.yshortcuts a span { color:#a6a7a3;text-decoration:none!important;border-bottom:none!important;background:none!important;}
]]>
</style>
<title></title>
</head>
<body bgcolor="#FFFFFF" style="min-width:100%;margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;padding-top:0;padding-bottom:0;padding-left:0;padding-right:0;color:#a6a7a3;font-family:Arial,sans-serif;">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<!-- // Begin Template Header \ -->
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><!--IMAGE (style-display:block;!!)--></td>
</tr>
</table><!-- // End Template Header \ -->
</td>
</tr>
<tr>
<td>
<!-- // Begin Template Body \ -->
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<!-- // Begin Module: Standard Content \ -->
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="color:#a6a7a3;font-size:14px;font-family:Arial,sans-serif;text-align:left;">
<b>Dear Sample,</b><br />
</td>
</tr>
<tr>
<td style="color:#a6a7a3;font-size:14px;font-family:Arial,sans-serif;text-align:left;">
Thank you for being with us. <!-- Start Transaction Information -->
</td>
</tr>
<tr>
<td style="color:#a6a7a3;font-size:14px;font-family:Arial,sans-serif;text-align:left;">
<b>Sample</b>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table border="0" cellpadding="3" cellspacing="0"><tr><td height="3"><table border="0" cellpadding="0" cellspacing="0"><tr><td></td></tr></table></td></tr></table>
</td>
</tr>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="text-align:left;font-family:Arial,sans-serif;font-size:14px;color:#a6a7a3;">Item Name</td>
<td style="text-align:left;font-family:Arial,sans-serif;font-size:14px;color:#a6a7a3;">Quantity</td>
<td style="text-align:left;font-family:Arial,sans-serif;font-size:14px;color:#a6a7a3;">Item Price</td>
<td style="text-align:left;font-family:Arial,sans-serif;font-size:14px;color:#a6a7a3;">Item Code</td>
<td style="text-align:left;font-family:Arial,sans-serif;font-size:14px;color:#a6a7a3;">Shipping</td>
</tr>
<tr>
<td style="text-align:left;font-family:Arial,sans-serif;font-size:14px;color:#a6a7a3;">'.$item.'</td>
<td style="text-align:left;font-family:Arial,sans-serif;font-size:14px;color:#a6a7a3;">'.$quantity.'</td>
<td style="text-align:left;font-family:Arial,sans-serif;font-size:14px;color:#a6a7a3;">'.$price.'</td>
<td style="text-align:left;font-family:Arial,sans-serif;font-size:14px;color:#a6a7a3;">'.$code.'</td>
<td style="text-align:left;font-family:Arial,sans-serif;font-size:14px;color:#a6a7a3;">'.$shipping.'</td>
</tr>
</table><!-- End Transaction Information -->
</td>
</tr>
</table><!-- // End Module: Standard Content \ -->
</td>
</tr>
</table><!-- // End Template Body \ -->
</td>
</tr>
</table>
</body>
</html>
Here is my code.My destination was: i will enter some content text(like articles), keywords and site url. And in the end keyword in text will be linked to url i was given for once.
But code doesnt work. So where is my mistakes?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Title</title>
</head>
<body>
<form name="form1" method="post" action="">
<div style="float:left">
<table width="40%" border="0" >
<tr>
<td height="30" class="yazi">Text</td>
<td height="30">:</td>
<td height="30">
<span class="formyazi"><textarea name="text1" cols="75" rows="25"></textarea><br></span>
</td>
</tr>
<tr>
<td width="23%" height="30" class="yazi">Keywords</td>
<td width="1%" height="30" class="style1">:</td>
<td width="76%" height="30">
<span class="formyazi"><input type="text" name="keywords" value=""></span>
</td>
</tr>
<tr>
<td width="23%" height="30" class="yazi">site adress</td>
<td width="1%" height="30" class="style1">:</td>
<td width="76%" height="30">
<span class="formyazi">http://<input type="text" name="site" value="">/</span>
</td>
</tr>
<tr>
<td height="55" colspan="3">
<input type="submit" class="button" style="font-size:10pt;color:#FFFFFF;border-style:solid;border-width:1;background-color:#0D78B3" value="Send!">
</td>
</tr>
</table>
</div>
</form>
<?php
$text2=$_POST["text1"];
$nesne=str_replace($keywords,'$keywords',$text2 ,1);
$linkedtext=$nesne;
?>
<div style="float:left">
<table width="40%" border="0" >
<tr>
<td height="30" class="yazi">Text with link</td>
<td height="30">:</td>
<td height="30">
<span class="formyazi"><textarea name="cikti" cols="75" rows="25"><?php echo $linkedtext;?></textarea><br></span>
</td>
</tr>
</table>
</div>
</body>
</html>
Since you've gotten the correct $_POST variables according to your comment, you need to fix this now
$nesne=str_replace($keywords,'$keywords',$text2 ,1);
You cannot put variables in a single-quote delimited string - use double quotes around it with single-quotes inside.
Like this:
$nesne=str_replace($keywords,"<a href='$link' title='$keywords' target='new'>$keywords</a>",$text2 ,1);
i have a table named as item_request and it has twofields named as projectmanager and createddate which has the Timestamp format as 2012-09-11 17:46:25.
Now i want to call these two fields in another form which count the user entry between 2 different dates.and the date field is fetched from the timestamp.with this form i m sending the value through datetime picker having the format 10-12-2012 but the value in databse is in different format and the value i m sending is in diffferent format.how is it possible plzzz help me guys.
Here is the code for my form:
<?php
include("config.php");
ob_start();
error_reporting(0);
if(!isset($_SESSION[username]))
header("location: index.php");
if(isset($_POST[submit]))
{
$projectmanager=mysql_real_escape_string($_POST['projectmanager']);
$date=mysql_real_escape_string($_POST['date']);
$dateexp = explode("-",$date);
$date = mysql_real_escape_string($dateexp[0]."/".$dateexp[1]."/".$dateexp[2]);
$date1=mysql_real_escape_string($_POST['date1']);
$dateexp1 = explode("-",$date1);
$date1 = mysql_real_escape_string($dateexp1[0]."/".$dateexp1[1]."/".$dateexp1[2]);
echo $queryuser= "select * from item_request where projectmanager=$projectmanager AND (requireddate>=$date AND requireddate<=$date1)";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Project Managers Registrarion</title>
<link rel="stylesheet" type="text/css" href="css/style.css"/>
<script language="javascript" type="text/javascript" src="js/datetimepicker.js">
//Date Time Picker script- by TengYong Ng of http://www.rainforestnet.com
//Script featured on JavaScript Kit (http://www.javascriptkit.com)
//For this script, visit http://www.javascriptkit.com
</script>
</head>
<body>
<div class="container">
<div class="header"><img src="images/cherry-new.jpg" width="79" height="93" />
<!-- end .header --></div>
<?php include("rightMenu.php");?>
<div class="content">
<h1>PR Count</h1>
<div style="padding:10px 0px; text-align:center; color:#990000;">
</div>
<form action="" method="post" name="loginform">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td>Project Managers</td>
<td><select name="projectmanager" style="width:145px;" id="projectmanager" onChange="showUser(this.options[this.selectedIndex].id)">
<option value="">Select</option>
<?php $queryuser= "select * from projectmanagers";
$fetuser1user = mysql_query($queryuser);
while($fetuser = mysql_fetch_array($fetuser1user)){
?>
<option id="<?php echo $fetuser['id']?>" value="<?php echo $fetuser['id']?>"><?php echo $fetuser['projectmanager']?></option>
<?php }
?>
</select></td>
</tr>
<tr>
<td>Date From</td>
<td>
<input id="date" type="text" size="20" name="date" /><img src="images/cal.gif" width="16" height="16" border="0" alt="Pick a date"></td>
</tr>
<tr>
<td>Date To</td>
<td>
<input id="date1" type="text" size="20" name="date1"><img src="images/cal.gif" width="16" height="16" border="0" alt="Pick a date"></td>
</tr>
<tr>
<td> </td>
<td>
<input type="submit" name="submit" id="submit" value="Submit" onClick="return formvalidate();"/>
</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
<table width="100%" border="1"><tr>
<td width="18%" valign="middle" class="tableheading">PI.No.</td>
<td width="18%" valign="middle" class="tableheading">Project Manager</td>
<td width="18%" valign="middle" class="tableheading">Date Created</td>
<td width="15%" valign="middle" class="tableheading">Action</td>
</tr>
<?php
// to print the records
$select = "select * from item_request";
$query1 = mysql_query($select);
while($value = mysql_fetch_array($query1)){ ?>
<tr>
<td class="tabletext"><?php echo $value[id];?></td>
<td class="tabletext"><?php echo $value[projectmanager];?></td>
<td class="tabletext"><?php echo $value[datefrom];?></td>
<td class="tabletext"><img src="images/edit.png" width="25" height="25" border="0" title="Edit" />
<img src="images/deleteBtn.png" width="25" height="25" border="0" title="Edit" /></td>
</tr><?php }?>
</table>
</form>
<!-- end .content --></div>
<?php include("footer.php");?>
<!-- end .container --></div>
</body>
</html>
Replace this function call...
javascript:NewCal('date','ddmmyyyy');
with this one...
javascript:NewCal('date','ddmmyyyy',true,24);
Hope it helps.
When i added <form> to my web page, all my javascript stopped working, and when i put the form at the begining of my table submit wont work, what i am doing wrong. below is my code after testing on other browser it works fine but on Firefox it doesn't
Update: After checking on firefox java error console it appears that Checking Function is defined
Update2: Solved my mistake was <script type="text/jscript"> is wrong thats why on firefox it wasn't working and on the rest it was, it must be <script type="text/javascript">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sabay Afrah.Inc | Contact Us</title>
<script src="js/clear.js" language="javascript" type="text/javascript"></script>
<script src="js/SpryValidationSelect.js" type="text/javascript"></script>
<script type="text/jscript">
function Checking(form){
if(empty(form.fname.value){
alert("do nothing");
}
}
</script>
<style type="text/css">
<!--
body {
background-color: #000;
}
body,td,th {
color: #FFF;
font-size: 14px;
}
.address {
font-family: "Comic Sans MS", cursive;
font-weight: bold;
}
-->
</style>
<link href="theme/style.css" rel="stylesheet" type="text/css" />
<link href="theme/SpryValidationSelect.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form action="enterdb.php" method="post">
<table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center"> </td>
</tr>
<tr>
<td><table width="1006" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="4"> </td>
<td width="93" align="right"> </td>
<td width="4"> </td>
<td width="374" ><img src="images/logo.png" width="230" height="114" /></td>
<td width="426" align="right" class="address">
10 GlenLake parkway<br />
Suite 130, mailbox # 76<br />
Atlanta, GA 30328<br />
Phone #: + 678-222-3442<br />
Fax #: +678-222-3401<br />
Office hours: M-F 8:30 a.m. to 5:00 p.m.<br />
</td>
<td width="99"> </td>
</tr>
<tr>
<td colspan="5"><table width="600" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
<td class="title"> </td>
</tr>
<tr>
<td width="84"><br /></td>
<td width="516" class="title">Contact Us</td>
</tr>
</table></td>
<td> </td>
</tr>
</table></td>
</tr>
<tr>
<td>
<table width="883" border="0" align="center" cellpadding="0" cellspacing="0">
<tr class="table">
<td width="27" rowspan="10" bgcolor="#330099" class="textable"> </td>
<td colspan="2" bgcolor="#330099" class="textable"> </td>
<td width="29" rowspan="8" bgcolor="#330099" class="textable"> </td>
<td colspan="3" class="textable"> </td>
</tr>
<tr >
<td width="139" height="31" bgcolor="#330099" class="textable">First Name:</td> <td>
<input id="fname" name="fname" type="text" size="40" /> </td>
<td width="150" class="textable">Last Name:</td>
<td width="265" class="textable"><table width="200" border="0" cellspacing="0" cellpadding="0">
<tr>
<td ><table width="200" border="0" cellspacing="0" cellpadding="0">
<tr>
<td ><input id="lname" name="lname" type="text" size="40" /></td>
</tr>
</table></td>
</tr>
</table></td>
<td width="32" class="textable"> </td>
</tr>
<tr>
<td height="30" class="textable">Subject:</td> <td>
<span id="spryselect1">
<label>
<select name="sub" id="sub">
<option> Choose a Subject</option>
<option> General Question</option>
<option> MemberShip Area</option>
<option> Others</option>
</select>
</label>
<span class="selectRequiredMsg">Please select a Subject.</span></span>
</td>
<td colspan="3" class="textable"> </td>
</tr>
<tr>
<td height="33" class="textable">Company Name:</td> <td> <input id="cname" name="cname" type="text" size="40" /></td>
<td class="textable">Company Address:</td>
<td class="textable"><table width="200" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input id="cadd" name="cadd" type="text" size="40" onclick="" /></td>
</tr>
</table></td>
<td class="textable"> </td>
</tr>
<tr>
<td height="31" class="textable">Phone Number:</td> <td><input id="phonen" name="phonen" type="text" size="40" /> </td>
<td colspan="3" rowspan="4" class="textable"> </td>
</tr>
<tr>
<td height="31" class="textable">Fax Number:</td><td> <input id="faxn" name="faxn" type="text" size="40" /></td>
</tr>
<tr>
<td height="32" class="textable">Email Address:</td><td><input id="email" name="email" type="text" size="40" /></td>
</tr>
<tr>
<td colspan="2" class="textable"> </td>
</tr>
<tr>
<td valign="top" class="textable">Additional Information:</td>
<td colspan="5" class="textable"><table width="600" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" align="center">
<textarea id="add" name="add" cols="70" rows="10" /></textarea>
</td>
</tr>
<tr>
<td align="center" class="textable">
<input name="Submit" type="submit" value="Submit" onclick="Checking()"/>
</td>
<td align="center" class="textable">
<input type="reset" value="Clear" />
</td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="6" class="textable"> </td>
</tr>
</table></td>
</tr>
</table>
</form>
<script type="text/javascript">
<!--
var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1");
//-->
</script>
</body>
</html>
Your function wants to take in the form element and your submit button doesn't send anything to the function. I'd assume it's not submitting because your function is erroring out and thus stopping the button as if it were returning false. Fix your JavaScript, try using Firebug to help you find these problems.
Try adding an onsubmit to your form tag:
<form action="enterdb.php" method="post" enctype="application/x-www-form-urlencoded" onsubmit="return Checking(this);">
Then remove the onclick event from the submit button.
You need to pass a form object to the Checking function, hence the this. Also it's usually better to place the handler in the form tag as it'll be called when the user submits the form by either clicking the submit button or by pressing enter elsewhere in the form.
Edited per webdestroya.
generally, suggest that you comment out first clear.js and SpryValidationSelect.js, and then try run your code by adding one by one javascript file to clearly defined what is the file that been crashing with your inline code text.
also try to add name for your form and try like this:
function Checking(form){
if(empty(window.myform.fname.value){
alert("do nothing");
}
}
in a way to debug something, its best to try different method by which sometimes you will spot the not easier.
just my thought. gudluck