Modifying the Form block

Permalink
I am trying to add additional field options to the form block. My new field ("ticketprice") has options (like the textarea and select fields do). When I edit a form and add a textarea or select field, the option fields for those two field types become visible. I can NOT get the edit form to do the same for my new field!

The HTML bit looks like this (truncated):
<div class="fieldRow">
         <div class="fieldLabel"><?php  echo t('Answer Type')?>: </div>
         <div class="fieldValues">
            <input name="answerType" type="radio" value="field" /> <?php  echo t('Text Field')?> &nbsp; <br>
            <input name="answerType" type="radio" value="text" /> <?php  echo t('Text Area')?> &nbsp; <br>
            <input name="answerType" type="radio" value="radios" /> <?php  echo t('Radio Buttons ')?> &nbsp; <br>
            <input name="answerType" type="radio" value="select" /> <?php  echo t('Select Box')?> &nbsp; <br>
            <input name="answerType" type="radio" value="checkboxlist" /> <?php  echo t('Checkbox List')?> &nbsp; <br>
            <input name="answerType" type="radio" value="fileupload" /> <?php  echo t('File Upload')?> <br>
            <input name="answerType" type="radio" value="email" /> <?php  echo t('Email')?> &nbsp; <br>
            <!-- non input fields -->
            <input name="answerType" type="radio" value="plaintext" /> <?php  echo t('Plain Text')?> &nbsp; <br>
            <input name="answerType" type="radio" value="divider" /> <?php  echo t('Divider')?> &nbsp; <br>
            <!-- payment fields -->
            <input name="answerType" type="radio" value="amount" /> <?php  echo t('Custom Amount')?> &nbsp; <br>


The auto.js file now looks like this:
var miniSurvey ={
   bid:0,
   serviceURL: $("input[name=miniSurveyServices]").val() + '?block=form&',
   init: function(){ 
         this.tabSetup();
         this.answerTypes=document.forms['ccm-block-form'].answerType;
         this.answerTypesEdit=document.forms['ccm-block-form'].answerTypeEdit; 
         for(var i=0;i<this.answerTypes.length;i++){
            this.answerTypes[i].onclick=function(){miniSurvey.optionsCheck(this);miniSurvey.settingsCheck(this);miniSurvey.ticketPriceCheck(this);}
            this.answerTypes[i].onchange=function(){miniSurvey.optionsCheck(this);miniSurvey.settingsCheck(this);miniSurvey.ticketPriceCheck(this);}
         } 
         for(var i=0;i<this.answerTypesEdit.length;i++){
            this.answerTypesEdit[i].onclick=function(){miniSurvey.optionsCheck(this,'Edit');miniSurvey.settingsCheck(this,'Edit');miniSurvey.ticketPriceCheck(this,'Edit');}
            this.answerTypesEdit[i].onchange=function(){miniSurvey.optionsCheck(this,'Edit');miniSurvey.settingsCheck(this,'Edit');miniSurvey.ticketPriceCheck(this,'Edit');}
         }


Line 62 seems to be the trouble point - I am checking to see if the field type we are adding is of type "ticketprice". So far, I can't get that to work. I tried debugging by setting the type to "text" and it worked... so it feels like the "valid" input types may be defined somewhere else?? Why isn't a new type working? If anyone is familiar with this code, I could use a hand. :(

WhiteChrys
 
volcaremos replied on at Permalink Reply
Hi WhiteChrys

did you ever resolve your problem with this customised form? I am trying to implement something similar, actually simpler since I only need to add options for a divider and header between fields. No luck yet.

cheers

V.
WhiteChrys replied on at Permalink Reply
WhiteChrys
I must have figured it out since I have dividers and plain text elements in mine now... I don't have access to the code at the moment but I will pull it up when I can.

This website stores cookies on your computer. These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media. To find out more about the cookies we use, see our Privacy Policy.