Forums

The 'guild application' Q&A and progress thread!

Mizpah 19 Nov, 2007
Hi All,

Firstly I anticipate that this will be a long thread ;-) As (likely) there will be a number of questions and posts, I am going to attempt to keep everything to one thread!

For background (and the challange!) see this thread
For the guild website (in beta!) see this link

As we start to get somewhere, I will post form links, and all files here (once complete I will move to the shared forms area!) It goes without saying that anyone is welcome to anything created here - so if you need somthing just ask!

So time to go on a journy, and see if this is possible! I intend to keep this thread up to date, almost as a mini blog, both as a reference, and in the hope that it helps someone else here!


Mizpah

Post edited by: Mizpah, at: 2007/11/19 00:36

PS: If the mods feel this is innapriopriate or in the wrong place, please let me know!<br><br>Post edited by: Mizpah, at: 2007/11/19 00:56
Mizpah 19 Nov, 2007
[file name=code_original.txt size=15569]http://www.chronoengine.com/components/com_fireboard/uploaded/files/code_original.txt[/file]

First Steps:

Installation, no issues in to RC3 J1.5!😉 - always a good start.

We have minor layout bug in the backend - the words 'form manager' split on the line incorrectly when the its not full screen

As I have very little coding experience I have opted to use woofu to create my forms with valid css and layout etc.

I have found it to be dead easy - however the free account has a limitation of 10 questions per form, and three forms. I have sent an email asking if there are options I can use that will let me mock up long forms, but not use the backend :whistle: - we will see, I don't mind paying a fee, but paying a monthly fee for occasional changes will be a bind - I guess I can just delete a form, and change queries, then try to merge the code ? But that will be a pain for colour changes and ad-hoc question chages - of which I expect many.

Anyhow, my first foray has led to the following (very basic) form, which will be the basis for the questions that everybody gets (as opposed to class or archetype, see the link in the orignal post):

Application Form

I have made some very minor code changes however.

(note: in woofu you can view the code, I simply copy pasted this into the 'form code' in the 'form:html' area - the rest of the fields were filled in logically, the submit value for woofu code is indeed 'Submit()')

Firsly the instructions pop up dialogue box ran 'over the top' of my side modules - ugh.

So off to fix it!

After trying to change several random values I discovered that:


form .instruct{
position:absolute;
top:0;
left:60%;
z-index:1000;
width:35%;
margin:0 0 0 8px;
padding:8px 10px 9px 10px;
border:1px solid #e6e6e6;
background:#f5f5f5;
line-height:130%;
font-size:80%;
color:#444;
visibility:hidden;
}


Controlled the position and the width of the 'pop up instructions'. Changeing the values 'left:100%;' to 60% move it left (doh!) and 'width:42%;' to 35% gave me the position and width I needed.

So how well did it work ?

Firslt, lets look at the email - no issues sending, however the first recieved email looked like this:

Field0 Mr
Field1 Test
Field4-1 16
Field4-2 08
Field4 1976
Field5 UK
Field16 Mizpah
Field17 0
Field11 Guardian
Field12 Aquilonian


Working, but as clear as mud! :blink: - Mainly due to the field names!

However this is not a chronoform issue, but connected with the names embedded in the code. After some searching I found the following:


<label class="desc" id="title0" for="Field0">
Name:
<span id="req_0" class="req">*</span>
</label>

<span>
<input id="Field0" 
name="Field0"
class="field text" size="8" 
tabindex="1"
value="" />
<label for="Field0">First</label>
</span>



Which after some testing, became:


<label class="desc" id="name" for="name">
Name:
<span id="req_0" class="req">*</span>
</label>

<span>
<input id="name_first" 
name="name_first"
class="field text" size="8" 
tabindex="1"
value="" />
<label for="name_first">First</label>
</span>


Of course I tested this before changing all of the field references, but applying this logic across the board, gives me the following email:

name_first Martin
name_surname Dean
dob_mm 08
dob_dd 16
dob_yyyy 1976
country UK
char_name Mizpah
char_level 1
class Guardian
Field12
char_race Stygan


Note the 'extra' field 12 (which is char_race) ? This seems to be connected with radio buttons, will deal with this later!

For anyone playing with this, I have attached the original, woofu code, as a .txt files! I will post the modified code in another thread!

Next post, getting it into the database!

Post edited by: Mizpah, at: 2007/11/19 01:07<br><br>Post edited by: Mizpah, at: 2007/11/19 01:12
Mizpah 19 Nov, 2007
The Database

Actually very simple, but I ran into one gotcha!

From the forms manager, you can click to create your table in the database. However if you then change names etc, you get an error - logical really! But there is no way (or none I have found?) to deal with those changes from within the forms componant.

So it was off to php myadmin, to drop jos_chronoforms_1 and then recreate it each time I made a change to the table structure (such as the field names - fine for testing, but changes and data saves will be needed for live!


When you create the table you need to specify the data 'type'. I personally went with the following, (please let me know if not correct!)

name_first varchar(255)
name_surname varchar(255)
dob_mm int(6)
dob_dd int(6)
dob_yyyy int(6)
country varchar(255)
char_name varchar(255)
char_level int(6)
class varchar(255)
Field12 varchar(255)
char_race varchar(255

(note: I have 'field_12' again - its empty in the db, will watch it for a while and try deleting it - is this down to the way that woofu creates a radio button, and chrono reads it ? - needs testing!)
Mizpah 19 Nov, 2007
Current Queries

Ok, before we even get into anything complex. lets see what issues we have we the current version!

Validation - no working validation, however this is not surprising, as I am not using the woofu backend, and I guess thier validation engine would work with the current code!

So I need to learn how to use the chrono validator element, at least I gained the red asterix's on the form!! :laugh:

Date - The date field is MM\DD\YYYY - and I am after UK date!

edit: doh! as these are just text fields, I can just change the field names and descriptions, however I will have to drop the db again once I change them!

Date field format! - I am surprised to see three text fields making up a date, I would have expected a date string to be posted straight to the database! I wonder if this will be an issue or not ?

(later I plan on calculating an actual age from the dob - later still I want to pull the dob from the user profile, still one step at a time!)

Date Picker - Does not transfer from Woofu code, need to find a way to replicate one in my form!

Post edited by: Mizpah, at: 2007/11/19 01:29<br><br>Post edited by: Mizpah, at: 2007/11/19 01:34
Mizpah 19 Nov, 2007
Validation!

Ok, time to get some basic validation working (I hope!)

I found this post whic allowed me to guess how it works, so lets start with making all of the fields required!

Note: Am I missing a general manual somewhere - or does this not exist as its beta! ? Oh well ;-0

It seems to be that placing the input_id against the type of validation, forces that validation.

So I have

name,dob_dd,dob_mm,dob_yyyy,country,char_name,char_level,class,char_race

in the first option, and

dob_dd,dob_mm,dob_yyyy,char_level

against the numeric option

(I should probably rename class to char_class for consistancy - is there any issue with having you id= and your name= set to the same thing ??!?)

Housten we seem to have a problem! B)

Firstly:

A few times I have seen the following when trying to test validation!

Fatal error: session_start() [<a href='function.session-start'>function.session-start</a>]: Failed to initialize storage module: user (path: /tmp) in /data01/natures/public_html/components/com_chronocontact/chronocontact.php on line 199

Secondly please see the attached screenshot!

Note that:

The text to indicate 'this is a required field' does not appear underneath text fields - the form can not be submitted, but its not clear why!

number validation - appears to work fine!

radio buttons - when I specify char_class as not able to be blank, it seems to want all of the buttons ticked, unless I specify the default as my actual choice! I suspect this may be my specific code for the radio button, please see below for clarity.

<p class="instruct " id="instruct11"><small>Please select your class, or planned class!</small></p>


</li><li class="   " id="fo1li12" >

<label class="desc" id="char_race">
Race:
<span id="req_12" class="req">*</span>
</label>

<span>
<input id="radioDefault" name="Field12" type="hidden" value=""/>

<input id="Field12_0" 
  name="char_race" 
   class="field radio" type="radio" 
tabindex="10"
   value="Aquilonian"  />
<label class="choice" for="Field12_0">Aquilonian</label>

<input id="Field12_1" 
  name="char_race" 
   class="field radio" type="radio" 
tabindex="11"
   value="Cimmerian"  />
<label class="choice" for="Field12_1">Cimmerian</label>

<input id="Field12_2" 
  name="char_race" 
   class="field radio" type="radio" 
tabindex="12"
   value="Stygan"  />
<label class="choice" for="Field12_2">Stygan</label>


So this leaves me with the following queries:

I would like to validate that char_level is a number between 1 and 80 - how can I do this ?

If I can't sort out a better 'date' method, I would like to validate each number, i.e. 0-31, 0-21 etc

Time to leave validation for a while and come back to it I think!!<br><br>Post edited by: Mizpah, at: 2007/11/19 02:34
Mizpah 19 Nov, 2007
Just a quick check !

Is this usefull to anybody here - or even just an interesting read - lets have some feedback please before I go too much further!
Mizpah 19 Nov, 2007
Starting to look at making the form questions dynamic!

Ok, those of you who have read the original post will be aware that I need to change the questions based on two factors -

The archetype of the charactor applying
The exact class of the charactor applying

Applications will be driven from a class specific link, hance this information should be available!

From greyheads earlier reply, it seems that I need to pass the variables in the link itself (get variables I think they were called?) in the format ?somthing=value&somthingelse=anothervalue

If I look at the php code, of the module where I show what classes are required (where I want the links!) I see this:

if ($guardian == "High"«»){
			$content  .= "                            <td><font class=\"content\"><b><font color=\"#00CC00>High</font></b></font></td>";
		}



So knowing that I need to change it to provide a link, I build a url string as follows:

{websiteurl}{formpath}{additionalvalues}

As my 'guiardian' is class 'guardian', itself in archetype 'soldier', my additional values are:

?archetype=soldier&class=guardian

Which leaves me with:


if ($guardian == "High"«»){
			$content  .= "                            <td><font class=\"content\"><b><font color=\"#00CC00\"><a href = \"/index.php?option=com_chronocontact&chronoformname=application_form?archetype=soldier&class=guardian\">High</a></font></b></font></td>";
		}


Problem! :unsure:

The string http://www.enigmaguild.org/index.php?option=com_chronocontact&chronoformname=application_form?archetype=soldier&class=guardian

Seems to not want to play - I guess it thinks the form name is 'application_form?archetype=soldier&class=guardian'

Hopefully this is just a syntax error - we havent even got to doing somthing with these values yet! - but I guess a sensable first step is getting them in existance, and linking correctly to the form!!

And on that note, its late and I am stopping fo the night!

Current issues:

correctly formatting a url string with extra values
validation issues
'date field' issues

I will pick this up again tomorow - hopefully some kind soul will have dropped me a few hints!

note: Although I ask the class in the current form I plan on removing this once its working!

Post edited by: Mizpah, at: 2007/11/19 03:31<br><br>Post edited by: Mizpah, at: 2007/11/19 12:26
GreyHead 19 Nov, 2007
Hi Mizpah,

You're on the right track, the only problem that I can see is that GET variables link with ? for the first, then & for all the rest so your link needs to be
www.enigmaguild.org/index.php?option=com_chronocontact&chronoformname=application_form&archetype=soldier&class=guardian
To test this create a dummy form that has some code like
<?php
echo print_r($_GET);
?>
This should show you the 'get array' with the values you have in your link.

Bob

PS Just as a suggestion, when you are developing keep the code as simple as possible, so leave out all the <font> tags until later, the more code the bigger the chance of a typo and the harder it is to find.

Hint 2 - in PHP you can happily use single quotes inside double quotes fro attribute values, this removes the need to escape the quotes and keeps the code simple e.g.
if ( $guardian == "High" ) {
  $content  .= "<td><font class='content' color='#00CC00'><b><a href='/index.php?option=com_chronocontact&chronoformname=application_form&
archetype=soldier&class=guardian'>High</a></b></font></td>";
}
Mizpah 19 Nov, 2007
Thanks again Grey, that works ;-)

I now see the following text in my introduction to the form:
(where I had placed your code)

( [option] => com_chronocontact [chronoformname] => application_form [archetype] => soldier [class] => guardian [demand] => high [Itemid] => ) 1Please be aware that some the information that you provide will be available on our forums for discussion.

Happy form filling!



Now I am off to find the syntax, to return a specific value in given place in the form:

i.e. "We see you are applying as a [value] please note that we have tailored your application form accordingly. If this is incorrect please go back and pick the correct link"

It then follows that I need to populate a value in the DB with the variable (i.e. char_class)

Once thats done I can build all of the links and remove the class question🙂

Miz

PS: I still need to implement your hints - it seems as if the font colour is being ignored anyhow at the moment!<br><br>Post edited by: GreyHead, at: 2007/11/19 16:29
Mizpah 19 Nov, 2007
Update! using 'get variables'

Well, a visit to W3Schools and I have progress!

http://www.w3schools.com/php/php_get.asp

The follwing code has the desired effect for displaying on screen:

<?php echo $_GET["class"]?>


Now I need to work out how to populate 'char_class' in the database with the value from 'class' (and in the email!), on submit, alongside the other values

Progress so far, I think we can confirm, is slow and steady ;-)
GreyHead 19 Nov, 2007
Hi Mizpah,

What needs to go into the Character class field? You could store it in the database but if' it's just a short list then putting an array into your php code could be just as easy. Here's an example:
$archetype_array = array(1=>'Priest', 2=>'Soldier', 3=>'Rogue', 4=> 'Mage');
$class_array_priest = array(1=>'Druid of the Storm', 2=>'Priest of the Mithran', 3=> Scion of Set', 4=> 'Bear Shaman');
Then you can refer to $class_array_priest[1] to get the 'Druid of teh Storm value.

Bob

PS Actually I'd probably do it as a two dimensional array but on'e enough to start with.

Bob
Mizpah 19 Nov, 2007
Heya Grey,

I think I see what you are saying on the last post but I may be missing how to apply it!

My recruitment page (beta) currently looks like this

As you will see, on the right hand side, is my recruitment status module.

If you click on guardian, it loads the form, for a Guardian (no real customisations yet to the questions), and in the introductory text, it point out to the applicant that they are applying as a guardian.

Therefore, I want to remove the question 'class' which currently populates the database value char_class.

I still want char_class to be populated however - but with the value 'class' as retrieved via the get$

This hopefully will mean that I have a record in the database, and can use the database to post content into the phpBb3 forum (later!).

I am wondering if I simply change the value from 'class' to 'char_class' it will get populated ? However I guess I need an interim step to put the value in a hidden field, and submit it with the rest of the form ??

Anyhow - I am about to complete all of the rest of the links, then I will revist this!!

Cheers,

Miz
GreyHead 19 Nov, 2007
Hi Miz,

All looks good so far. I'm not quite clear what you are doing with char & char_class - but almost certainly it cna be done!

Bob
Mizpah 19 Nov, 2007
Trying to be too clever now!

After getting the links working, and displaying the class type, I am now trying to change the text dosplayed, depending on the values. After reading the original reply, and by being 'logical' I have come up with this:


<?php
$demand = $_GET["demand"]
switch ($demand)
{
case "High":
  echo "As you are aware demand for your class is currently high.  This means that we will be recruiting 2 or 3 applicants, so keep an eye on your inbox!";
  break;
case "Medium":
  echo "As you are aware demand for your class is currently medium.  This means that we will be recruiting only 1 or possibly 2 applicants, Please keep an eye on your inbox!";
  break;
case "Low":
  echo "As you will have seen recruitment is currently low for your class, This means that we are only looking for exceptional applicants, as such please do not be dissapointed if you do not hear from us!";
  break;
default:
  echo "You are applying whilst recruitment is closed for your class.  Therefore unless you are an exceedingly strong applicant, we will be placing your details on file for later use.";
}
?>
<br />


This *should* be geting the value 'demand' , setting it as a variable, and then evaluating it as a case statement, to decide which pargraph to include.

However, the result is:


Parse error: syntax error, unexpected T_SWITCH in /data01/natures/public_html/components/com_chronocontact/chronocontact.html.php(55) : eval()'d code on line 581

So, I have taken it out for now - again I assume this is a syntax issue (have never used the switch command before), once more I look for pointers!<br><br>Post edited by: Mizpah, at: 2007/11/19 20:45
GreyHead 19 Nov, 2007
Hi Miz,

You need a ; to close the $demand = $_GET["demand"]; line I think that's all.

Bob

PS actually you don't need that line. This will work as well:
switch ($_GET["demand"]) {
case 'High': . . .


Post edited by: GreyHead, at: 2007/11/19 18:54<br><br>Post edited by: GreyHead, at: 2007/11/19 18:55
Mizpah 20 Nov, 2007
Hi All,

Grey\Bob - Thanks as always for the prompt responces - it seems with that code syntax you can be *this* close - but still miles away!😉

No back to the grindstone;

I currently have the following working:

[list=1]
  • Form Filling

  • Some Validation

  • Email to recipient

  • Submit to database

  • Forms linked from url's in another J!1.5 module with $Get values

  • php '(switch)' changing the text in the into of a form
  • [/list:o] That's entirely down to help on this forum - and for anyone wondering if they can use this, I dont think that's bad for the timescale and my lack of experience :laugh:

    However, as always, onwards and upwards!

    Current Issues:

    Submit Char_Class to database
    As I have the character class specified in the links that load the form, I no longer need to ask the question in the form - however when the form is submitted to the database, I want to insert the character class value, as I do currently (with the question present). Will experiment with this!

    Date 'picker' and validation
    I have a continual mistrust of my date field! When I move onto the next steps (publish to phpBB3 forum), one of the fields I want to publish is age, and to do that I will need to calculate it from dob! I would like to get the 'date picker' working, and to submit an actual date value to the database - not three seperate numbers!

    Validation
    I seem to have some issues with validation, please see the previous post in this thread on the topic
    Mizpah 20 Nov, 2007
    Oh and seeing as I have got this far - although its not in use yet,

    Purchased! :woohoo:

    Thanks for all the help once more - now, back to the grindstone...
    GreyHead 20 Nov, 2007
    Hi Miz,

    Right I need to go for dinner now - and I've just found a whole page of posts that you'd made before I started reading the thread. I've printed them out to take with me and will reply later.

    On Validation. I'm not sure that ChronoForms Validation works quite correctly if you try to do multiple validations of the same field. You might be better off going back to the source code (link on the JS tuturial page) and implementing that by hand.

    Wufoo is great BUT the code they let you copy isn't the same as the code they use on their forms - some of the neat bits gt taken out :-( But still a good way to generate basic form code.

    Bob
    Mizpah 20 Nov, 2007
    doh! well it seems that I have finally managed to break somthing!

    I was playing with trying to get the class submitted without asking the question,

    So I deleted this:
    <div>
    <select class="field select medium" 
    id="class" 
    name="class"
    tabindex="9"> 
    <option value="Guardian" 
    >Guardian</option>
    <option value="Conqueror" 
    >Conqueror</option>
    <option value="Dark Templar" 
    >Dark Templar</option>
    <option value="Priest of Mitra" 
    >Priest of Mitra</option>
    <option value="Scion of Set" 
    >Scion of Set</option>
    <option value="Druid of the Storm" 
    >Druid of the Storm</option>
    <option value="Bear Shamen" 
    >Bear Shamen</option>
    <option value="Barbarian" 
    >Barbarian</option>
    <option value="Assassin" 
    >Assassin</option>
    <option value="Ranger" 
    >Ranger</option>
    <option value="Lich" 
    >Lich</option>
    <option value="Necromancer" 
    >Necromancer</option>
    <option value="Herald of Xotli" 
    >Herald of Xotli</option>
    <option value="Demonologist" 
    >Demonologist</option>
    </select>
    </div>


    and replaced it with:

     <input type="hidden" name="Class" value="<?php echo $_GET['Class']; ?>" />


    However all I get now is:

    Fatal error: session_start() [<a href='function.session-start'>function.session-start</a>]: Failed to initialize storage module: user (path: /tmp) in /data01/natures/public_html/components/com_chronocontact/chronocontact.php on line 199

    So I replaced the code, and am still seeing the same error - I wonder when it snuck in ?

    This seems not to be related to the code change! (or at least not this one).

    Things tried so far:

    Have removed all validation
    Have published\unpublished the form
    Have dropped and recreated jos_chropnoforms_1
    Have started the form from the form manager ( no $_Get params)

    Am still seeing the same :blink:

    Edit: Have just created the 'test form' from the how to section - that works perfectly, so it must be me somewhere!

    :laugh: Found It! :laugh:

    I must have turned on Antispam, image verification at some point! I Turned it off and it works once more...

    Now to see if I can remove this class field again!


    Post edited by: Mizpah, at: 2007/11/19 22:12<br><br>Post edited by: Mizpah, at: 2007/11/19 22:18
    Mizpah 20 Nov, 2007
    I now have a hidden field populating the form!

    <input type="hidden" name="class" value="<?php echo $_GET['class']; ?>" /> 


    Works perfectly, my previous attempt had 'Class' (wrong case) and was clouded by the verification issue!
    Mizpah 20 Nov, 2007
    Possible backup\restore bug\issue ?

    Ok i went back to woofu, and tried to gain a theme - so I carefully created it, grabbed the code, carefully ran a backup, and then overwrote my existing form code.

    However the woofu code did not help me, so I decided to go back to my backup, I therefore deleted the current form, and selected restore and ran the restore.

    Unfirtunately nothing happened!

    Am I missing somthing ?

    My restore file is attached :unsure:

    [file name=application_form2.cfbak size=17441]http://www.chronoengine.com/components/com_fireboard/uploaded/files/application_form2.cfbak[/file]
    Mizpah 20 Nov, 2007
    Ok,

    I have things running again, after copy pasting from the restore, file and recreating the form, however it appears that there may be a bug with the restore function (or I may be blind - both are very possible :whistle: )

    Now lets start on trying to customise some actual questions!
    Mizpah 20 Nov, 2007
    Customising questions and sections!

    Now its time to try to customise some sections! Firstly I am going to try to introduce two new section headers, archetype and class.

    Archetype should look somthing like this:

    
    <?php
     switch ($_GET["archetype"]) {
    
    case "Soldier":
      echo "Soldier Questions to go here!";
      break;
    case "Priest":
      echo "Priest Questions to go here!";
      break;
    case "Rogue":
      echo "Rogue questions to go here!";
      break;
    case: "Mage":
    echo "Mage questions to go here"
    default:
      echo "Hmm, We seem not to have been able to detect a class! Have you followed a valid link ? Please try again and contact webmaster@enigmaguild.org if this problem persists!";
    }
    ?>
    


    class should look somthing like this
    
    <?php
     switch ($_GET["archetype"]) {
    
    case "Soldier":
      echo "Soldier Questions to go here!";
      break;
    case "Priest":
      echo "Priest Questions to go here!";
      break;
    case "Rogue":
      echo "Rogue questions to go here!";
      break;
    case: "Mage":
    echo "Mage questions to go here"
    default:
      echo "Hmm, We seem not to have been able to detect a class! Have you followed a valid link ? Please try again and contact webmaster@enigmaguild.org if this problem persists!";
    }
    ?>
    
    <br><br>Post edited by: Mizpah, at: 2007/11/20 00:07
    GreyHead 20 Nov, 2007
    Hi Miz,

    The backup form you posted restored OK for me (though I'm still on v 2.3.5).

    Bob
    GreyHead 20 Nov, 2007
    Hi Miz,

    Responding to very old posts (by your standards!)

    . . .
    Field17 0
    Field11 Guardian
    Field12 Aquilonian

    Working, but as clear as mud! - Mainly due to the field names!

    The Elements Titles tab in ChronoForms is designed to deal with this. You can put 'Field17=Character Level' in there and it will put the friendly version into the email.

    Bob
    GreyHead 20 Nov, 2007
    Hi Miz,

    Working with dates. Your date fields will work OK. You should probably validate them though, some clown will enter a silly date for sure.

    You should probably store your dates in the database as Unix timestamps - a long integer that equates to the number of seconds since 1/1/70. There can be a problem with dates before this which require negative timestamps but I think most of these are in the past. But check before you go too far!

    You can use $timestamp = strtotime( mm dd yyyy); to generate a timestamp and date (format string, $timestamp); to display it in the format of your choice - see the PHP manual for the format syntax.

    Bob
    Mizpah 20 Nov, 2007
    (re: backup)

    hmm,

    Well it doesnt here! :side:

    I have got around it however - do you see a confirmation message after restoring ?

    I get a 'blank' backend screen, that looks like it should hold a confirm message after submitting the file.

    Do you have a 2.3.5 backup file that is known to work, that you want me to test ?<br><br>Post edited by: Mizpah, at: 2007/11/20 00:56
    GreyHead 20 Nov, 2007
    Hi Miz,

    No confirmation message (at least I don't remember one) - the form just shows up at the bottom of the Forms Manager list.

    Bob
    Mizpah 20 Nov, 2007

    Hi Miz,

    Responding to very old posts (by your standards!)

    . . .
    Field17 0
    Field11 Guardian
    Field12 Aquilonian

    Working, but as clear as mud! - Mainly due to the field names!

    The Elements Titles tab in ChronoForms is designed to deal with this. You can put 'Field17=Character Level' in there and it will put the friendly version into the email.

    Bob



    Ok, I 'fixed' this by editing the field names, so they had changed directly in the database columns - is there an advantage or disadvantage to doing it either way ?<br><br>Post edited by: Mizpah, at: 2007/11/20 00:58
    GreyHead 20 Nov, 2007
    Hi Miz,

    No particular advantage - except that field names can't contain space and Element Titles names can.

    Bob
    Mizpah 20 Nov, 2007

    Hi Miz,

    No confirmation message (at least I don't remember one) - the form just shows up at the bottom of the Forms Manager list.

    Bob



    [file name=test_form-03b7d19cc98d8e5d019bb5e410e8524c.cfbak size=1800]http://www.chronoengine.com/components/com_fireboard/uploaded/files/test_form-03b7d19cc98d8e5d019bb5e410e8524c.cfbak[/file]

    Hi Bob,

    I think you have a bug to investigate in the 1.5 beta!

    I have just created the generic test_form, used it, backed it up, deleted it, restored it - same behaviour I am afraid!

    I will create a new install in another wamp instance just to be sure, but I reccomend that you check!

    Cheers,

    Miz
    GreyHead 20 Nov, 2007
    Hi MIz,

    That's good too - I have 2.3.4 J1.5 BETA 1.0 installed. Will upgrade and test again. Max has made some changes but only to file paths I think.

    Bob
    Mizpah 21 Nov, 2007
    ok, we are getting sme solid progress now with the basic form, which leads me to this one:

    In the intro section I use:

    <p>Welcome to our application form! Before you get two carried away with form filling, we have detected that you are applying as a <b><?php echo $_GET["class"]?></b> - please ensure this is correct, as we will have tailored your application form accordingly! If this happens to be incorrect please go back and
    pick the correct link in the recruitment module.</p>



    Now, this works fine, However if $_GET["class"] returns nothing, is there way of forcing an entry ?

    i.e. the result of "class" or 'error - no class detected!' ?

    Cheers,

    Miz
    GreyHead 21 Nov, 2007
    Hi Miz,

    The code you need is
    <?php
    if ( $_GET['class'] != "" ) {
      echo $_GET['class'];
    } else {
      echo "Houston, we've got a problem.";
    }
    ?>
    To make the code management easier I prefer to set up the variables before I write the html, so for me it woudl look like:
    <?php
    if ( $_GET['class'] != "" ) {
      $class = $_GET['class'];
    } else {
      $class = "Houston, we've got a problem.";
    }
    ?>
    <p>Welcome to our application form! Before you get two carried away with form filling, we have detected that you are applying as a <b><?php echo $class; ?></b> - please ensure this is correct, as we will have tailored your application form accordingly! If this happens to be incorrect please go back and pick the correct link in the recruitment module.</p>
    Bob
    Mizpah 21 Nov, 2007
    Thansk Bob,

    Progress is still solid - if slow ;-)

    I have started writing the whole form out again by hand to make sure I actually understand it - and pick up all of the errors I had introduced!

    Here's what we have so far with the first section nearly complete!

    Recruitment Page (Pick any class name to activate the form!)

    The code is attached for anyone interested! [file name=form.txt size=21422]http://www.chronoengine.com/components/com_fireboard/uploaded/files/form.txt[/file]

    I still need to implement your last suggestion, but am going to get all of the rest of the 'always asked' questions blocked out first!

    Am off to Chicago on friday, so I may run out of time soon till I come back!

    Miz<br><br>Post edited by: Mizpah, at: 2007/11/21 02:17
    GreyHead 21 Nov, 2007
    Hi Miz,

    That's looking good, nice piece of work and a very effective use of PHP with ChronoForms to create a customised form.

    I'm off to London tomorrow too - back on Monday. Have a good Thanksgiving weekend.

    Bob
    Mizpah 21 Nov, 2007
    Aww,

    Shame about the timing,if I were here I would have tried to buy you a drink for the help!

    Enjoy London!

    Miz
    GreyHead 21 Nov, 2007
    Hi Miz,

    Well I'm still *here* until tomorrow, though here happens to be in France - still, if you area round🙂

    Bob
    Mizpah 22 Nov, 2007
    and I assumed 'here' was somwhere in the States! That makes you about as much of an insomniac as I am!😈

    Miz

    PS: perhaps I should have offered Absinthé then ?

    PPS:For the avoidence of doubt I am usually found near Birmingham in the UK!
    Mizpah 22 Nov, 2007
    *ok, back to work!*

    In the current form I have now completed section one, (yay).

    But I have discovered two new errors,

    Link

    1) When viewed inside the template, the middle section is 'dropped' down, and the background shows through at the top. See how the line is broken and the we don't see unbroken blue ?

    I can't quite see how this is happening, it only seems to happen on pages with a form on, any ideas ?

    2) The 'About You' field should only be as wide as the text field above. Changing the cols value seems to have no effect!

    <div>
    <textarea id="Field5" 
    class="field textarea medium"
    name="about" 
    rows="10" cols="50" 
    tabindex="5" ></textarea>
    </div>


    Will revisit these later, back to section2!

    Miz
    GreyHead 22 Nov, 2007
    Hi Miz,

    That page looks fine to me in FF.

    Bob

    PS I'm packing to go to London so will now be off-line mostly until Monday.
    This topic is locked and no more replies can be posted.