Results 1 to 3 of 3

Thread: forms can't be submitted?

  1. #1
    Join Date
    Dec 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default forms can't be submitted?

    1) Script Title:
    Ajax Tabs Content Script (v 2.2)
    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...axtabscontent/
    3) Describe problem:

    ill try to explain it. I have a form on my website, that works without the ajax tabs. but when i fill the form in a ajax tabs contents webpage, it doens't work.

    Examples:

    With Ajax tabs content script (it won't work):
    http://www.wirdumonline.nl/vier/ , klik right on the pencill en fill the form


    without the script (and works!!)
    http://www.wirdumonline.nl/vier/hoofdpagina.php , klik right on the pencill en fill the form

    Here is the php code for the form:
    Code:
    <?
    mysql_connect("localhost","***", "***")
       or die("kan de MySQL server niet selecteren");
    mysql_select_db("wirdum_wistjedat")
        or die("kan de database niet selecteren");
    if(isset($_POST['submit']) && isset($_POST['bericht']))
    {
    	
    	include('../include/functies.php');    
    	
    	$ip			= $_SERVER['REMOTE_ADDR'];
    	$datum		= date("d-m-Y");
    	$tijd		= date("H:i:s");
        $bericht 	= bbcode ($_POST['bericht']);
    	$naam		= $_POST['naam'];
        $query 		= mysql_query("SELECT * FROM wistjedat2 ORDER BY id DESC LIMIT 1") or die(mysql_error());
        $result 	= mysql_fetch_object($query);
    	
    if($naam == "")
    	{
    		$error	= "<b>Oops! Je naam is ook alweer?</b></br>";
    }
    elseif ($bericht == "")
    	  {
    	    $error	= "<b>Oops! Je was je bericht vergeten.</b></br>";
    	  
    	}
        else
        {
            $bericht = addslashes($bericht);
            $query = mysql_query("INSERT INTO wistjedat2 VALUES ('','$bericht', '$ip', '$tijd', '$datum', '$naam')") or die(mysql_error());
    		echo "<meta http-equiv='refresh' content='0'; url='http://www.wirdumonline.nl/vier/' /> " ; /* Stuur de browser naar de PHP website */
    		exit;                        /* Zorg dat de code hieronder niet wordt uitgevoerd */
        }
    }
    ?>
    
    <?
    	if(isset($error))
    	{
    		echo $error;
    	}
       
    ?>
              
    <h4><img src="img/pencil_add.png" alt="Show Div" style="cursor:pointer;" onclick="showContent(this);"></h4>
    
    <div style="margin-top:0px; display:none;">
    <form method="post" name="wistjedat" >
    <input name="submit" type="hidden" value="submit">
    <strong> Wist je dat..</strong><br>
    <input name="bericht" type="text" value="" size="35" maxlength="120">
    [BBcode is AAN]
    <br>
    <br>
    Smilies:
    <br>
    <a name='plaatsen'></a><img style="margin: 1px; margin-left: 0px" onMouseover="this.style.cursor='pointer'" onClick="sendtext(document.wistjedat.bericht, ':)')" src="images/smilies/smile.gif" alt="Emoticon"> <img style="margin: 1px" onMouseover="this.style.cursor='pointer'" onClick="sendtext(document.wistjedat.bericht, ':D')" src="images/smilies/biggrin.gif" alt="Emoticon"> <img style="margin: 1px" onMouseover="this.style.cursor='pointer'" onClick="sendtext(document.wistjedat.bericht, ':p')" src="images/smilies/tongue.gif" alt="Emoticon"> <img style="margin: 1px" onMouseover="this.style.cursor='pointer'" onClick="sendtext(document.wistjedat.bericht, ':(')" src="images/smilies/sad.gif" alt="Emoticon"> <img style="margin: 1px" onMouseover="this.style.cursor='pointer'" onClick="sendtext(document.wistjedat.bericht, ';)')" src="images/smilies/wink.gif" alt="Emoticon"> <img style="margin: 1px" onMouseover="this.style.cursor='pointer'" onClick="sendtext(document.wistjedat.bericht, ':angry')" src="images/smilies/angry.gif" alt="Emoticon"> <img style="margin: 1px; margin-left: 0px" onMouseover="this.style.cursor='pointer'" onClick="sendtext(document.wistjedat.bericht, ':roll')" src="images/smilies/rolleyes.gif" alt="Emoticon"> <img style="margin: 1px" onMouseover="this.style.cursor='pointer'" onClick="sendtext(document.wistjedat.bericht, ':kiss')" src="images/smilies/kiss.gif" alt="Emoticon"> <img style="margin: 1px" onMouseover="this.style.cursor='pointer'" onClick="sendtext(document.wistjedat.bericht, ':cool')" src="images/smilies/cool.gif" alt="Emoticon"> <img style="margin: 1px" onMouseover="this.style.cursor='pointer'" onClick="sendtext(document.wistjedat.bericht, ':cry')" src="images/smilies/cry.gif" alt="Emoticon"> <img style="margin: 1px" onMouseover="this.style.cursor='pointer'" onClick="sendtext(document.wistjedat.bericht, ':huh')" src="images/smilies/huh.gif" alt="Emoticon"> <img style="margin: 1px" onMouseover="this.style.cursor='pointer'" onClick="sendtext(document.wistjedat.bericht, ':omg')" src="images/smilies/omg.gif" alt="Emoticon"><br>
    Naam:<br>
    <input name="naam" type="text" value="" size="9" maxlength="5">
    <br>
    <br>
    <input name="submit2" type="submit" value="Plaats">
    </form>
    i really don't understand it someone can help me ?

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Well I can't quite see what is happening. I can say that any javascript on a page imported via AJAX will not run. And that if your form's HTML is invalid, it might work without AJAX but then get messed up when imported via AJAX.

    My advice, if it works without AJAX, use it without AJAX. After all, you have a PHP enabled server, you may include the form on the page via PHP.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Dec 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thanks, i will do it without the ajax tabs then. Im getting tired when forms and other php stuff didn't work.

    Now it works without ajax and with include php.

    thanks!

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
  •