TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

May 03, 2024, 03:28:18 PM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,178
  • Total Topics: 21,220
  • Online today: 106
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 1
  • Guests: 76
  • Total: 77
  • @rjen

Forms not allowed in article editor?

Started by misjka, March 21, 2006, 09:06:03 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

misjka

Hi there!

Recently I tried to write an article which contained a form (incl. a cgi-bin action), but as I was to publish the article as admin the article totally screwed up the portal formatting, and the Send-button did not work... I give you all my form code here:




<FORM name=form1 action=/cgi-sys/FormMail-clone.cgi method=post
      encType=multipart/form-data>
      <TABLE cellSpacing=2 cellPadding=2 width="100%" border=0>
        <TBODY>
        <TR>
          <TH class=smallTableHeader scope=col colSpan=2>
            <H2 align=center><INPUT type=hidden value=info@rm8s.net
            name=recipient> <INPUT type=hidden value="Wanna be a [RM8s] mate!"
            name=subject> <INPUT type=hidden
            value=http://www.rm8s.net/html/formThx.shtml name=redirect> <INPUT
            type=hidden value=http://www.rm8s.net/html/formErrMissField.shtml
            name=missing_fields_redirect> <INPUT id=required type=hidden
            value=realname,email,RM8sNickName,ManifestoChecked name=required>
            <INPUT id=order type=hidden
            value=order:realname,email,RM8sNickName,Nationality,City,checkbox1,checkbox2,checkbox3,checkbox4,checkbox5,checkbox6,checkbox7,checkbox8,checkbox9,checkbox10,checkbox11,checkbox12,checkbox13,PreferOtherSims,LFSWNameS1,LFSWNameS2,Comments
            name=sort> [RM8s] Application Form </H2></TH></TR>
        <TR>
          <TD class=smallTableText scope=col width="30%">
            <DIV align=right>Your full name:</DIV></TD>
          <TD class=smallTableText scope=col>
            <DIV align=left><INPUT size=40 name=realname> *Required</DIV></TD></TR>
        <TR>
          <TD class=smallTableText>
            <DIV align=right>Your valid e-mail address: </DIV></TD>
          <TD class=smallTableText>
            <DIV align=left><INPUT size=40 name=email> *Required</DIV></TD></TR>
        <TR>
          <TD class=smallTableText>
            <DIV align=right>Preferred [RM8s] nick name: </DIV></TD>
          <TD class=smallTableText><INPUT id=RM8sNickName maxLength=6 size=6
            name=RM8sNickName> @rm8s.com *Required</TD></TR>
        <TR>
          <TD class=smallTableText vAlign=top height=110>
            <DIV align=right>Preferred racing sims: </DIV></TD>
          <TD class=smallTableText vAlign=top width="70%"><INPUT id=checkbox1
            type=checkbox value="I prefer LFS" name=checkbox1> Live For
            Speed<BR><INPUT id=checkbox2 type=checkbox value="I prefer GTR"
            name=checkbox2> GTR<BR><INPUT type=checkbox
            value="I prefer Nascar 2003" name=checkbox3> Nascar Racing 2003
            Season<BR><INPUT type=checkbox value="I prefer F1 Challenge 99-02"
            name=checkbox4> F1 Challenge '99-'02<BR><INPUT type=checkbox
            value="I prefer other sim(s)" name=checkbox5> Other(s): <INPUT
            id=PreferOtherSims maxLength=40 size=40 name=PreferOtherSims></TD></TR>
        <TR>
          <TD class=smallTableText vAlign=top height=158>
            <DIV align=right>You are a...:</DIV></TD>
          <TD vAlign=top>
            <P class=smallTableText><INPUT id=checkbox6 type=checkbox
            value="I'm a LFS S1 demo driver" name=checkbox6> Live For Speed S1
            demo driver<BR><INPUT id=checkbox7 type=checkbox
            value="I'm a LFS S1 licensed driver" name=checkbox7> Live For Speed
            S1 licensed driver. Your LFSW name: <INPUT id=LFSWNameS1
            maxLength=15 size=10 name=LFSWNameS1> <BR><INPUT id=checkbox8
            type=checkbox value="I'm a LFS S2 demo driver" name=checkbox8> Live
            For Speed S2 demo driver<BR><INPUT id=checkbox9 type=checkbox
            value="I'm a LFS S2 licensed driver" name=checkbox9> Live For Speed
            S2 licensed driver. Your LFSW name: <INPUT id=LFSWNameS2
            maxLength=15 size=10 name=LFSWNameS2> <BR><INPUT id=checkbox10
            type=checkbox value="I'm a GTR demo driver" name=checkbox10> GTR
            demo driver<BR><INPUT id=checkbox11 type=checkbox
            value="I'm a GTR licensed driver" name=checkbox11> GTR licensed
            driver<BR><INPUT id=checkbox12 type=checkbox
            value="I'm a Nascar 2003 demo driver" name=checkbox12> Nascar 2003
            demo driver<BR><INPUT id=checkbox13 type=checkbox
            value="I'm a Nascar 2003 licensed driver" name=checkbox13> Nascar
            2003 licensed driver </P></TD></TR>
        <TR>
          <TD class=smallTableText>
            <DIV align=right>Your nationality: </DIV></TD>
          <TD><SELECT id=Nationality name=Nationality> <OPTION value=Sweden
              selected>Sweden</OPTION> <OPTION value=Norway>Norway</OPTION>
              <OPTION value=Denmark>Denmark</OPTION> <OPTION
              value=Finland>Finland</OPTION></SELECT> <SPAN
            class=smallTableText>*Required</SPAN></TD></TR>
        <TR>
          <TD class=smallTableText height=31>
            <DIV align=right>City:</DIV></TD>
          <TD><INPUT id=City size=35 name=City> <SPAN
            class=smallTableText>*Required</SPAN></TD></TR>
        <TR>
          <TD class=smallTableText vAlign=top>
            <DIV align=right>Any comments: </DIV></TD>
          <TD><TEXTAREA id=Comments name=Comments rows=4 cols=50></TEXTAREA></TD></TR>
        <TR>
          <TD class=smallTableText>&nbsp;</TD>
          <TD><INPUT id=ManifestoChecked type=checkbox value=checkbox
            name=ManifestoChecked> <SPAN class=smallTableText>I have read the <A
            href="http://www.rm8s.net/html/manifesto.shtml">manifesto</A> and
            agree with it. *Required</SPAN></TD></TR>
        <TR>
          <TD class=smallTableText>
            <DIV align=right><INPUT type=reset value=Clear name=Reset> </DIV></TD>
          <TD>
            <DIV align=left><INPUT type=submit value=Submit name=Submit>
          </DIV></TD></TR></TBODY></TABLE></FORM>




Is there a way to make articles with forms work in the Approval screen...? As it seems, it's the Clear and Submit part of the form that screws the formatting up, since that part of the form shows up above the rest of the form in the Approval screen although it should remain below...

(Ô¿Ô)

Give this a try

<form name="form1" action="/cgi-sys/FormMail-clone.cgi" method= "post" enctype="multipart/form-data" id="form1"><table cellspacing="2" cellpadding="2" width="100%" border="0"><tbody><tr><th class="smallTableHeader" scope="col" colspan="2"><h2
align="center"><input type="hidden" value="info@rm8s.net" name="recipient"><input type="hidden" value= "Wanna be a [RM8s] mate!" name="subject"><input type="hidden" value="http://www.rm8s.net/html/formThx.shtml" name="redirect"><input type="hidden"
value= "http://www.rm8s.net/html/formErrMissField.shtml" name= "missing_fields_redirect"><input id="required" type="hidden" value="realname,email,RM8sNickName,ManifestoChecked" name= "required"><input id="order" type="hidden" value=
"order:realname,email,RM8sNickName,Nationality,City,checkbox1,checkbox2,checkbox3,checkbox4,checkbox5,checkbox6,checkbox7,checkbox8,checkbox9,checkbox10,checkbox11,checkbox12,checkbox13,PreferOtherSims,LFSWNameS1,LFSWNameS2,Comments" name="sort">
[RM8s] Application Form</h2></th></tr><tr><td class="smallTableText" scope="col" width="30%"><div align="right">Your full name:</div></td><td class="smallTableText" scope="col"><div align="left"><input size="40" name="realname"> *Required</div>
</td></tr><tr><td class="smallTableText"><div align="right">Your valid e-mail address:</div></td><td class="smallTableText"><div align="left"><input size="40" name="email"> *Required</div></td></tr><tr><td class="smallTableText"><div
align="right">Preferred [RM8s] nick name:</div></td><td class="smallTableText"><input id="RM8sNickName" maxlength="6" size="6" name="RM8sNickName"> @rm8s.com *Required</td></tr><tr><td class="smallTableText" valign="top" height="110"><div
align="right">Preferred racing sims:</div></td><td class="smallTableText" valign="top" width="70%"><input id= "checkbox1" type="checkbox" value="I prefer LFS" name= "checkbox1"> Live For Speed<br><input id="checkbox2" type="checkbox" value="I prefer
GTR" name= "checkbox2"> GTR<br><input type="checkbox" value="I prefer Nascar 2003" name= "checkbox3"> Nascar Racing 2003 Season<br><input type="checkbox" value="I prefer F1 Challenge 99-02" name= "checkbox4"> F1 Challenge '99-'02<br><input
type="checkbox" value="I prefer other sim(s)" name= "checkbox5"> Other(s): <input id="PreferOtherSims" maxlength="40" size="40" name="PreferOtherSims"></td></tr><tr><td class="smallTableText" valign="top" height="158"><div align="right">You are
a...:</div></td><td valign="top"><p class="smallTableText"><input id="checkbox6" type="checkbox" value="I'm a LFS S1 demo driver" name="checkbox6"> Live For Speed S1 demo driver<br><input id="checkbox7" type="checkbox" value= "I'm a LFS S1 licensed
driver" name="checkbox7"> Live For Speed S1 licensed driver. Your LFSW name: <input id="LFSWNameS1" maxlength="15" size="10" name="LFSWNameS1"><br><input id="checkbox8" type="checkbox" value= "I'm a LFS S2 demo driver" name="checkbox8"> Live For Speed
S2 demo driver<br><input id="checkbox9" type="checkbox" value= "I'm a LFS S2 licensed driver" name="checkbox9"> Live For Speed S2 licensed driver. Your LFSW name: <input id="LFSWNameS2" maxlength="15" size="10" name="LFSWNameS2"><br><input
id="checkbox10" type="checkbox" value= "I'm a GTR demo driver" name="checkbox10"> GTR demo driver<br><input id="checkbox11" type="checkbox" value= "I'm a GTR licensed driver" name="checkbox11"> GTR licensed driver<br><input id="checkbox12"
type="checkbox" value= "I'm a Nascar 2003 demo driver" name="checkbox12"> Nascar 2003 demo driver<br><input id="checkbox13" type="checkbox" value= "I'm a Nascar 2003 licensed driver" name="checkbox13"> Nascar 2003 licensed driver</p></td></tr><tr>
<td class="smallTableText"><div align="right">Your nationality:</div></td><td><select id="Nationality" name="Nationality"><option value="Sweden" selected>Sweden</option><option value="Norway">Norway</option><option
value="Denmark">Denmark</option><option value="Finland">Finland</option></select><span class="smallTableText">*Required</span></td></tr><tr><td class="smallTableText" height="31"><div align="right">City:</div></td><td><input id="City"
size="35" name="City"><span class= "smallTableText">*Required</span></td></tr><tr><td class="smallTableText" valign="top"><div align="right">Any comments:</div></td><td><textarea id="Comments" name="Comments" rows="4" cols="50">
</textarea></td></tr></tbody></table>
</form>


By getting rid of the whitespace i have gotten these to work sometimes. But tp's articles section isn't all that capable yet so there are no guarantees.

misjka

#2
Thanks for quick response! But, to me it seems like the Clear and Submit section of the form is missing in your code...?

It happened to me too sometimes, that the buttons were removed from the code after I had approved the article...

And still, the formatting of the Approval screen looks pretty messy over here... :(

Turning the wysiwyg editor off doesn't make it work better either...

(Ô¿Ô)

That is strange. Ill see what I can come up with and post it back here. I do know that the wysisyg editor really sucks even when it isnt turned on. Ive never found one worth anything.

misjka

Much obliged  :P!

Yeah, I've also been messing around with some wysiwyg editors and unfortunately I have the same experience... :( I wonder: Why is it so hard to accomplish a good editor, since this really should be one of the most important modules in a portal/cms?!?

bloc

Try to remove the "align=right" in the last divs there, and rather set it inside the <td> instead.

But I am curious, is the layout the only thing not working? Or doesn't it get sent at all?

misjka

Well, if I write the article as admin there will be no problems publishing it... But, if I write it as a user, then the admin's approval won't work (Send button doesn't work). If written by admin, editing the article later on won't work either...

OK, I'll check that aligning...

misjka

I removed the align in two last divs, but the was nothing much for a change... :-\ It really looks like it's the Submit & Clear buttons that screw things up...

Crip

PHP forms do work well in Articels, .cgi/perl maybe the problem?
I have become comfortably numb!

Cripzone | Crip's Free 2.0.2 Themes



Elen

I also have problems with forms in articles.  I can create a new article with a form in it but am unable to change it in any way as the send button doesn't work.  I've turned off the wysiwyg editor and it hasn't made any difference.  What I have noticed since I turned it off is that the form code seems to be interpreted by TP as part of the article page.  At the top of the edit article page I have a white box with the code in it - up to where the form starts!  The form itself is not editable and is displayed as part of the edit page.  Is there a way around this - without using an iFrame?

bloc

What if you name the send button something other than "submit" or "send"?

Elen

#11
On my form, the button is called "Apply to join..." and has never been called submit or send.  The page is at http://www.crimson-dragoonz.com/crimson/index.php?page=23

When I try and edit the article the following appears in the editable text area

QuoteCrimson Dragoonz Application Form
    <p>If you wish to join the Crimson Dragoonz please fill in the form below.</p>
   
<p>We will try to contact you about your application in-game as soon as possible
  however please leave a valid e-mail address so that we have an alternative means
  of contacting you. If your application is successful a forum account will be
  created for you using this e-mail address. Please complete all of the fields.</p>
       
  <p> </p>
        <form action="http://www.crimson-dragoonz.com/cgi-bin/apply.cgi" method="post">
            <input name="mail_sent" value="http://www.crimson-dragoonz.com/crimson/index.php?page=20" type="hidden">
         <input name="subject" value="Application To Join The Crimson Dragoonz" type="hidden">
         <p>Character Name: <input name="name" size="20" type="text"></p>
          <p>Email address: <input name="email" size="20" type="text"></p>
            <p>Class:
                <select name="class"><option selected="selected">Druid</option><option>Hunter</option><option>Mage</option><option>Paladin</option><option>Priest</option><option>Rogue</option><option>Warlock</option><option>Warrior</option></select></p>
            <p>Level: <input name="level" size="5" value="0" type="text"></p>
            <p>Previous/Current Guild(s)</p>
            <textarea name="guild" cols="40" rows="3">
         

The other fields from the form appear underneath the text area, as if they were part of the edit options followed by the proper edit options.  I can't do a screen shot as I'm at work :(

Edited to add: It's just occurred to me that the split occurs at the first </textarea> tag.  If I create a new form with no textarea fields it's fine and I can edit it.

misjka

Quotetag.  If I create a new form with no textarea fields it's fine and I can edit it.

Ahh, maybe this is the key to it all??

iowamf

Quote from: misjka on March 29, 2006, 05:48:03 AM
Quotetag.  If I create a new form with no textarea fields it's fine and I can edit it.
Ahh, maybe this is the key to it all??

I think the textarea is the key.

I was trying to create a php form using a textarea and I think the non WYSIWYG editor was "executing" my code the 2nd time I brought up the article in an edit window.

A work around is to never edit the article twice - if you have to change it delete it and start over. Hey, less than ideal - but this works.

misjka

OK... But is it possible to e.g. use the iframe tag in an article to include an external html document...? That way one maybe could store the form outside the cms/portal but still have it available for viewing within the portal.. Haven't tested that idea...

Elen

Personally, I would like to avoid an iFrame but I think it might be possible to have it as a PHP include?  The downside is that you wouldn't be able to edit it via the articles which is what i really need to be able to do :(

iowamf

#16
I think this is a temporary bug - I wouldn't design around it.

The only hassle (as I understand it) is that you can't use the existing editor to modify an existing PHP article with a form using a textarea.

You can always use an external editor and past paste the code into a new article each time you want a change.

misjka

Yeah, that doesn't sound too hard to accomplish... But, the thing is to remember this special treatment of those articles  :o - especially as it comes to articles that aren't modified for quite some while (I'm talking about several months, maybe up to a year or so)...

Simply hope this bug will disappear before the final TP release...