Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6751279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:54:28+00:00 2026-05-26T12:54:28+00:00

i try to use the tinybox Javascript. Now i will try to use it

  • 0

i try to use the tinybox Javascript.

Now i will try to use it on submit, but i don’t know how!?

<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>

Now it shows me the tinybox but nothing happens, the box is empty.

This is my 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;
    }

In my Html Head i linked the Tinybox CSS and JS

<link rel="stylesheet" type="text/css" href="css/tinybox.css" />
<script type="text/javascript" src="js/tinybox.js"></script>

here is the 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)
?> 

I’m new on JS, i hope some one can help me… without tinybox it works perfectly

Thank you very mutch

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T12:54:29+00:00Added an answer on May 26, 2026 at 12:54 pm

    Since you have

    <input type="text" name="Deutsch" class="addBoxD" />
    

    I suspect

    if (document.forms["addVoc"].German.value==""){
    

    should read

    if (document.forms["addVoc"].Deutsch.value==""){
    

    Also, you should add

    return true;
    

    to the last line of the checkForm() function.

    I doubt either of these will fix your tinybox problem – this most likely because the system/import.php does not output anything.

    Load system/import.php in your browser and make sure you get the output you expect. If you do, make sure that system/import.php is the correct relative path from the current page to get to import.php. If all of this is correct, please edit the question to include the source code of import.php.

    Having said all that, it does seem a little odd to have the tiny box called as the action attribute of the form – are you sure this is what you want to do? What exactly are you trying to achieve here?

    EDIT

    Try this:

    HTML

    <div id="add">
    <form name="addVoc" action="javascript:void(0);" onsubmit="return checkForm();">
        <img src="images/gb.png" width="13px" height="8px"> Englisch: <input type="text" name="Englisch" class="addBox" />
        <img src="images/de.png" width="13px" height="8px"> Deutsch: <input type="text" name="Deutsch" class="addBoxD" /><br><br>
        <img src="images/icon_hinweis.gif" width="10px" height="10px"> Add Voc <input type="submit" class="sbutton" value="Add"/>
    </form>
    

    Javascript

    function checkForm(){
    
        if (document.forms["addVoc"].Englisch.value=="") {
            alert('Upps!'); 
            return false;
        }
        if (document.forms["addVoc"].Deutsch.value==""){
            alert('Upps!');
            return false;
        }
    
        TINY.box.show('system/import.php?Englisch='+document.forms["addVoc"].Englisch.value+'&Deutsch='+document.forms["addVoc"].Deutsch.value,1,300,150,1);
    
        return false;
    
    }
    

    PHP

    <?php
    
      include 'include/connect.php';
    
      if (!$db_link = mysql_connect(MYSQL_HOST, MYSQL_BENUTZER, MYSQL_KENNWORT)) {
        die('Konnte keine Verbindung: ' . mysql_error());
      }
      mysql_select_db("vokabel", $db_link);
    
      $sql = "INSERT INTO `word` 
                (`Englisch`, `Deutsch`)
              VALUES
                ('".mysql_real_escape_string($_GET['Englisch'])."','".mysql_real_escape_string($_GET['Deutsch'])."')";
    
      if (!mysql_query($sql,$db_link)) {
        die('Fehler: ' . mysql_error());
      }
    
      echo "Vokabel wurde hinzugefügt!";
    
      mysql_close($db_link)
    
    ?>
    

    ANOTHER EDIT

    If you are using Tinybox 2, change this line:

    TINY.box.show('system/import.php?Englisch='+document.forms["addVoc"].Englisch.value+'&Deutsch='+document.forms["addVoc"].Deutsch.value,1,300,150,1);
    

    To this:

    TINY.box.show({url:'system/import.php',post:'Englisch='+document.forms["addVoc"].Englisch.value+'&Deutsch='+document.forms["addVoc"].Deutsch.value,width:300,height:150});
    

    And change the two occurences of $_GET in import.php to $_POST.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try to use doctest from example from http://docs.python.org/library/doctest.html But when I run python
I try to use this mapping : @Entity @Table(name=ecc.\RATE\) @Inheritance(strategy=InheritanceType.SINGLE_TABLE) @DiscriminatorColumn(name=DISCRIMINATOR, discriminatorType= DiscriminatorType.STRING) public
RegexBuddy shows the matches are OK, but in C# when I try use replace,
I try use List instead of List List<?> list = new ArrayList<Integer>(); ... list.add(1);
how to generate random number in this code? I try use $RANDOM, but the
I try to use this code for toggling text on the link: var showText=<span>Open</span>
I try to use the domainpeople.com API and to do I need to use
I try to use the winDBG to debug a dump file. When I run
I try to use the following code: ArrayList<String> Map<String, String> Eclipse complains about both
I try to use PHPMailer to send registration, activation. etc mail to users: require(class.phpmailer.php);

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.