You are not logged in.
Pages: 1
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
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
I would also appreciate a solutions, as this happens here too, but only on one formular. Everything else works without this.
Offline
does it happen all the time??
...i asked allready, but how do you submit the form?
Niko
Offline
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 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
ok, and the submit-button?
please post a bit more of your form...
Niko
Offline
<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
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
@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
@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
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
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
call form.onsubmit() bevore doing the check!
(as in form.onsubmit() xinha copies the content from the iframe into the textarea)
Niko
Offline
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
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
Pages: 1