Jump to content

Problem with form in Internet Explorer


Deckhengst

Recommended Posts

Hello,

First at all: Sorry if my English is not perfect, but I don't speak (type) it very well. Thanks for your understanding.

I'm having a problem with my guestbook in Internet Explorer. There's no problem with Firefox or Opera, but in Internet Explorer, the script doesn't works.

The values of the textboxes are sended, but the buttons not. I' see that the page reloads, but it doesn't write the message in my database. There's only a problem when I have 2 buttons off the same type. With one button apart it works, but when I place all the buttons at once on the page, it doesn't works.

Is there anyone who has a solution for this problem, it should help me a lot!

Here's the code:

[code]<?php

$guestName    = isset($_POST['guestName']) ? $_POST['guestName'] : '';
$guestMail    = isset($_POST['guestMail']) ? $_POST['guestMail'] : '';
$showGuestMail = isset($_POST['showGuestMail']) ? $_POST['showGuestMail'] : 'true';
$guestURL      = isset($_POST['guestURL']) ? $_POST['guestURL'] : 'http://';
$guestMessage  = isset($_POST['guestMessage']) ? $_POST['guestMessage'] : '';
$guestIP      = ip2long($_SERVER['REMOTE_ADDR']);

if(isset($_POST['writeMessage']) || isset($_POST['previewMessage'])) {
    include '../files/scripts/guestbook/controle.php';
    if($guestControle == 'true') {
        if(isset($_POST['writeMessage'])) {
            include '../files/scripts/guestbook/write.php';
            include '../files/scripts/guestbook/view.php';
        } else {
            include '../files/scripts/guestbook/preview.php';
        }
    }
} else {
    include '../files/scripts/guestbook/view.php';
}

if($showGuestMail == 'false') {
    $guestCheked = ' checked="checked"';
} else {
    $guestCheked = '';
}

echo

'<script language="JavaScript" type="text/javascript" src="../files/scripts/insert_UBB.js"></script>
<form name="guestbook" method="POST" action="?page=guestbook">
            <table>
                <tr>
                    <td>
                        Naam:*
                    </td>
                    <td>
                        <input type="text" name="guestName" size="30" value="'.$guestName.'" tabindex="1">
                    </td>
                </tr>
                <tr>
                    <td>
                        E-Mail:
                    </td>
                    <td>
                        <input type="text" name="guestMail" size="30" value="'.$guestMail.'" tabindex="2">
                    </td>
                </tr>
                <tr>
                    <td>
                    </td>
                    <td>
                        <input type="checkbox" name="showGuestMail" value="false"'.$guestCheked.' tabindex="3" /> E-mailadres verbergen voor bezoekers
                    </td>
                </tr>
                <tr>
                    <td>
                        Website:
                    </td>
                    <td>
                        <input type="text" name="guestURL" value="'.$guestURL.'" size="30" tabindex="4">
                    </td>
                </tr>
                <tr>
                    <td>
                        Bericht:*
                    </td>
                    <td>
                        <img src="../files/styles/'.$siteStyle.'/buttons/UBB/bold.png" id="UBB" alt="Vet" title="Vet" onClick="javascript:bb(\'[b]\',\'[/b]\')" height="18px" width="23px">
                        <img src="../files/styles/'.$siteStyle.'/buttons/UBB/italic.png" id="UBB" alt="Cursief" title="Cursief" onClick="javascript:bb(\'[i]\',\'[/i]\')" height="18px" width="23px">
                        <img src="../files/styles/'.$siteStyle.'/buttons/UBB/underlined.png" id="UBB" alt="Onderlijnen" title="Onderlijnen" onClick="javascript:bb(\'[u]\',\'[/u]\')" height="18px" width="23px">
                        <img src="../files/styles/'.$siteStyle.'/buttons/UBB/striked_trough.png" id="UBB" alt="Doorstrepen" title="Doorstrepen" onClick="javascript:bb(\'[s]\',\'[/s]\')" height="18px" width="23px">
                        <img src="../files/styles/'.$siteStyle.'/buttons/UBB/superscript.png" id="UBB" alt="Superschrift" title="Superschrift" onClick="javascript:bb(\'[sup]\',\'[/sup]\')" height="18px" width="23px">
                        <img src="../files/styles/'.$siteStyle.'/buttons/UBB/subscript.png" id="UBB" alt="Subschrift" title="Subschrift" onClick="javascript:bb(\'[sub]\',\'[/sub]\')" height="18px" width="23px">
                        <img src="../files/styles/'.$siteStyle.'/buttons/UBB/link.png" id="UBB" alt="Link" title="Link" onClick="javascript:bb(\'[url]\',\'[/url]\')" height="18px" width="23px">
                        <img src="../files/styles/'.$siteStyle.'/buttons/email.png" id="UBB" alt="Email" title="Email" onClick="javascript:bb(\'[email]\',\'[/email]\')" height="18px" width="23px">
                        <img src="../files/styles/'.$siteStyle.'/buttons/UBB/image.png" id="UBB" alt="Afbeelding" title="Afbeelding" onClick="javascript:bb(\'[img]\',\'[/img]\')" height="18px" width="23px">
                        <img src="../files/styles/'.$siteStyle.'/buttons/UBB/list.png" id="UBB" alt="Lijst" title="Lijst" onClick="javascript:bb(\'[list]\',\'[/list]\')" height="18px" width="23px">
                        <a href="javascript:bb(\'\n[quote]\',\'\n[/quote]\')">quote</a>
                        <br /><textarea name="guestMessage" cols="60" rows="5" tabindex="5">'.$guestMessage.'</textarea>
                    </td>
                </tr>
                <tr>
                    <td>
                        Smilies:
                    </td>
                    <td>';

include '../files/scripts/insert_smilie.php';

echo

'                        <a href="'.$siteURL.'/public_html/smilies.php" onclick="smiliesPopup=window.open(this.href,\'smilies\',\'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=400,height=500\'); return false;">[meer]</a>
                    </td>
                </tr>
                <tr>
                    <td>
                    </td>
                    <td>
                        <input type="image" name="writeMessage" value="Verstuur" title="Verstuur" accesskey="v" tabindex="6" src="../files/styles/'.$siteStyle.'/buttons/submit.png" id="UBB" alt="Verstuur" />
                        <input type="image" name="previewMessage" value="Voorbeeld" title="Voorbeeld" accesskey="b" tabindex="7" src="../files/styles/'.$siteStyle.'/buttons/preview.png" id="UBB" alt="Voorbeeld" />
                        <button type="reset" name="resetMessage" value="Invoer wissen" title="Invoer wissen" accesskey="w" tabindex="8" style="background:#D1D1D1; border:hidden; cursor:pointer;"><img src="../files/styles/'.$siteStyle.'/buttons/reset.png" id="UBB" alt="Invoer  wissen" /></button>
                    </td>
                </tr>
            </table>
        </form>';

?>[/code]
Link to comment
Share on other sites

  • 2 weeks later...
AHHH

sorry didn't pick this up before. I think it is IE that when you use the image input type it transfers teh co-ordinates you cliked on teh image rather than a true value.

put your method back to post and then use print_r($_POST); to view all the info sent - if you submit the page in FF you should get a different set of values for the image buttons than IE.

Can I suggest you go and use a standard submit button? style it perhaps but use a standard button - some browsers do funny things to image inputs (I believe safari just replaces them with a blank apple glass button).
Link to comment
Share on other sites

[quote author=ToonMariner link=topic=119651.msg497125#msg497125 date=1167955695]
AHHH

sorry didn't pick this up before. I think it is IE that when you use the image input type it transfers teh co-ordinates you cliked on teh image rather than a true value.

put your method back to post and then use print_r($_POST); to view all the info sent - if you submit the page in FF you should get a different set of values for the image buttons than IE.

Can I suggest you go and use a standard submit button? style it perhaps but use a standard button - some browsers do funny things to image inputs (I believe safari just replaces them with a blank apple glass button).
[/quote]

If there 's no other solution I'll use the standard button, but if perhaps someone else has a solution, it would even be better.

Anyway, thanks a lot
    Deckhengst
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.