Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2005-04-22 03:29:44

Henry
New member
Registered: 2005-04-22
Posts: 5

Text not accepted

I am using a very simple newssystem (with php and mysql) for my website and have started using Xinha for managing the news items. But when I enter a new item (or alter an old one) I have to toggle HTML source to get the message accepted when submitting it. It looks like the changes made in HTML-mode are not recognized, but in TEXT-mode the are.

Offline

#2 2005-04-22 05:13:51

niko
Xinha Authority
From: Salzburg/Austria
Registered: 2005-02-14
Posts: 338

Re: Text not accepted

how do you submit your form?
do you have a normal submit-button or do you call form.submit()?
(if you call form.submit() you must call form.onsubmit() just bevore that)


Niko

Offline

#3 2005-04-22 08:13:21

ray
Xinha Administrator
From: Germany
Registered: 2005-03-23
Posts: 521
Website

Re: Text not accepted

My users have experienced a similar problem when pasting text from word to xinha in IE.

Offline

#4 2005-04-24 16:44:00

Mirical Bernd
Xinha Community Member
Registered: 2005-02-17
Posts: 14

Re: Text not accepted

I would also appreciate a solutions, as this happens here too, but only on one formular. Everything else works without this.

Offline

#5 2005-04-25 03:39:47

niko
Xinha Authority
From: Salzburg/Austria
Registered: 2005-02-14
Posts: 338

Re: Text not accepted

does it happen all the time??
...i asked allready, but how do you submit the form?


Niko

Offline

#6 2005-04-25 06:46:09

Mirical Bernd
Xinha Community Member
Registered: 2005-02-17
Posts: 14

Re: Text not accepted

That's the beginnig of the formular:

<FORM ACTION="SCRIPT" METHOD="post" NAME="gewinnspiele" ID="gewinnspiele" enctype="multipart/form-data">

The action is different, but I thought no one is interested in the full URL wink However this is from a formular where it works right:

<FORM ACTION="SCRIPT" METHOD="post" NAME="aktuelles" ID="aktuelles" enctype="multipart/form-data">

Both work with "post" as you can see. Only name and id are different. The enctype is also the same.

Yes it happens on the "gewinnspiele" every time, but happens - if I recall it right - only with Firefox.

Last edited by Mirical Bernd (2005-04-25 06:46:59)

Offline

#7 2005-04-25 08:51:23

niko
Xinha Authority
From: Salzburg/Austria
Registered: 2005-02-14
Posts: 338

Re: Text not accepted

ok, and the submit-button?
please post a bit more of your form...


Niko

Offline

#8 2005-04-25 08:54:14

Mirical Bernd
Xinha Community Member
Registered: 2005-02-17
Posts: 14

Re: Text not accepted

<INPUT TYPE="submit" value="News hinzufügen" accesskey="s" title="(Alt + S zum Abschicken)">  <INPUT TYPE="reset" value="Zurücksetzen" accesskey="x" title="(Alt + X zum Abbrechen)">

And the form is closed underneath.

Offline

#9 2005-04-26 03:45:51

Henry
New member
Registered: 2005-04-22
Posts: 5

Re: Text not accepted

Hello Niko,

I have been offline for a while so i'm a bit late with my answer but i'm using the following line to submit the form:

<input type="button" onClick="javascript:document.Form_AddNews.submit();" value="Sla bericht op.">

Offline

#10 2005-04-26 05:40:03

niko
Xinha Authority
From: Salzburg/Austria
Registered: 2005-02-14
Posts: 338

Re: Text not accepted

@bernd:
sorry, but i don't have a clue whats wrong there...
if it would be possible - could you write a little demonstration-script and upload it somewhere - so that we can reproduce this error?

@henry:
use this one:

<input type="submit" value="Sla bericht op.">

or call this javascript: (a function must be defined somewhere in the header)

document.Form_AddNews.onsubmit();
document.Form_AddNews.submit();

Niko

Offline

#11 2005-04-26 06:19:48

Mirical Bernd
Xinha Community Member
Registered: 2005-02-17
Posts: 14

Re: Text not accepted

niko wrote:

@bernd:
sorry, but i don't have a clue whats wrong there...
if it would be possible - could you write a little demonstration-script and upload it somewhere - so that we can reproduce this error?

That's the big problem. I tried to reproduce it, but I can't. On other forms, build in the same way it works. The init of the editor is identical, as I only have it written once in my templates.

However, here are the html-files of the formular. Some things have been changed (the domain i.e.), but not the form itself:

http://www.splashpages.de/newentrysnippets.zip

The "Gewinnspiel"-Snippet is the one with the problem. The "News"-Snippet works. Both use the same xinha. Maybe this can help.

Offline

#12 2005-04-26 06:38:01

Henry
New member
Registered: 2005-04-22
Posts: 5

Re: Text not accepted

I have done the latter (with the javascript) because I do some field checking. This seems to work but one of the checks is to see if the fields are empty and to my surprise when I don't enter any data in the textarea the code says there is a ^M (newline) in it so the check fails.

Offline

#13 2005-04-26 06:57:11

Mirical Bernd
Xinha Community Member
Registered: 2005-02-17
Posts: 14

Re: Text not accepted

Henry wrote:

to my surprise when I don't enter any data in the textarea the code says there is a ^M (newline) in it so the check fails.

Known problem. Would be great, if this could be solved too. Because I make some checks on my site, whether the text-area was empty and stumple upon this some times and it's not that nice.

Offline

#14 2005-04-26 11:20:26

niko
Xinha Authority
From: Salzburg/Austria
Registered: 2005-02-14
Posts: 338

Re: Text not accepted

call form.onsubmit() bevore doing the check!

(as in form.onsubmit() xinha copies the content from the iframe into the textarea)


Niko

Offline

#15 2005-04-27 02:27:05

Henry
New member
Registered: 2005-04-22
Posts: 5

Re: Text not accepted

niko wrote:

call form.onsubmit() bevore doing the check!

Hello niko,

Here's a snippet from the code:

<html>
<head>
<title>Nieuws</title>
<link rel="stylesheet" href="/vvw.css" type="text/css" charset="ISO-8859-1">

<script language="javascript1.2">
function AddArticle () {
    document.Form_AddNews.onsubmit ();
    document.Form_AddNews.submit ();
}
</script>

<script type="text/javascript">
    _editor_url  = "/xinha/";
    _editor_lang = "nl";
</script>

<script type="text/javascript" src="/xinha/htmlarea.js"></script>
<script type="text/javascript" src="/xinha/my_config.js"></script>

</head>

<body>
<br \>
<br \>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr></tr>
    <tr> 
        <td valign="top"> 
        <form method="POST" name="Form_AddNews" action="/mynews/admin.php?p=AddNews" enctype="multipart/form-data">
        Titel:<br \>
        <input type="text" name="Title" value="" size="50">
        <br \>
        <br \>
        Bericht:<br \>
        <textarea name="Message" id="Message" style="width: 100%"></textarea>
        <br \>
        <input type="button" onClick="javascript:AddArticle();" value="Sla bericht op1.">
          
        </form>
    </td>
    </tr>
    <tr></tr>
</table>
</body>
</html>

Where do I have to put the check?

Offline

#16 2005-04-27 09:43:38

niko
Xinha Authority
From: Salzburg/Austria
Registered: 2005-02-14
Posts: 338

Re: Text not accepted

like this:

function AddArticle () {
    document.Form_AddNews.onsubmit ();
    if(document.getElementById('Message').innerHTML=="") {
       alert('error, field empty...');
       return(false);
    }
    document.Form_AddNews.submit ();
}

(don't know if innerHTML is right...)


Niko

Offline

Board footer

Powered by FluxBB