我尝试使用tinybox Javascript。TinyBox窗体Bug
现在我会尝试使用它提交,但我不知道如何!?
<div id="add">
<form name="addVoc" action="javascript:TINY.box.show('system/import.php',1,300,150,1);" method="post" onsubmit='return checkForm();'>
<img src="images/gb.png" width="13px" height="8px"> English: <input type="text" name="English" class="addBox" />
<img src="images/de.png" width="13px" height="8px"> German: <input type="text" name="German" class="addBoxD" /><br><br>
<img src="images/icon_hinweis.gif" width="10px" height="10px"> Add Voc <input type="submit" class="sbutton" value="Add"/>
</form>
现在它向我展示了tinybox,但没有任何反应,盒子是空的。
这是我的JS checkForm()
function checkForm(){
if (document.forms["addVoc"].English.value==""){
alert('Upps!');
return false;
}
if (document.forms["addVoc"].German.value==""){
alert('Upps!');
return false;
}
return true;
}
在我的HTML的头,我挂迷你组合套件CSS和JS
<link rel="stylesheet" type="text/css" href="css/tinybox.css" />
<script type="text/javascript" src="js/tinybox.js"></script>
这里是import.php:
<?php
include 'include/connect.php';
$db_link = mysql_connect (MYSQL_HOST, MYSQL_BENUTZER, MYSQL_KENNWORT);
if (!$db_link)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("vokabel", $db_link);
$sql="INSERT INTO word (Englisch, Deutsch)
VALUES
('$_POST[Englisch]','$_POST[Deutsch]')";
if (!mysql_query($sql,$db_link))
{
die('Error: ' . mysql_error());
}
echo "Vokabel wurde hinzugefügt!";
mysql_close($db_link)
?>
我是新的JS,我希望有人能帮助我...没有tinybox它完美的作品
谢谢非常mutch
请勿使用TinyBox。 它没有记录,源代码被混淆。 你会一直有麻烦 – John