0

This is in relation to a previous question (DIV "hiding" when changing dropdown value) that helped me fix one part of the problem but I now have 2 problems to fix and finalise this form.

  1. If I don't add a Guest Ticket, there is no need for the Payment Method - the div containing these fields is currently just hidden but how do I remove the mandatory component if no payment is required?

  2. The Guest Ticket values are numbered from 0-10 so now when the form is submitted with "NONE" on Guest Tickets, the email displaying the form submission is indicating Guest = 1 because None has a value of 1.

Here is the latest JSFIDDLE = http://jsfiddle.net/4REan/1/

A snippet of the HMTL is here:

        <div class="clear">
        <label for="CAT_Custom_266143">Member Tickets: <span class="req">*</span></label>
        <select style="width: 120px;" name="CAT_Custom_266143" id="CAT_Custom_266143" class="cat_dropdown">
        <option value=" ">-- Please select --</option>
        <option value="None">NONE</option>
        <option value="1 Ticket">1 Ticket = $0</option>
        <option value="2 Tickets">2 Tickets = $0</option>
        <option value="3 Tickets">3 Tickets = $0</option>
        <option value="4 Tickets">4 Tickets = $0</option>
        <option value="5 Tickets">5 Tickets = $0</option>
        <option value="6 Tickets">6 Tickets = $0</option>
        <option value="7 Tickets">7 Tickets = $0</option>
        <option value="8 Tickets">8 Tickets = $0</option>
        <option value="9 Tickets">9 Tickets = $0</option>
        <option value="10 Tickets">10 Tickets = $0</option>
        </select>
        <label for="CAT_Custom_266107">Guest Tickets: <span class="req">*</span></label>
        <select style="width: 120px;" name="CAT_Custom_266107" id="CAT_Custom_266107" class="cat_dropdown">
        <option value="0">-- Please select --</option>
        <option value="1">NONE</option>
        <option value="2">1 Ticket = $15</option>
        <option value="3">2 Tickets = $30</option>
        <option value="4">3 Tickets = $45</option>
        <option value="5">4 Tickets = $60</option>
        <option value="6">5 Tickets = $75</option>
        <option value="7">6 Tickets = $90</option>
        <option value="8">7 Tickets = $105</option>
        <option value="9">8 Tickets = $120</option>
        <option value="10">9 Tickets = $135</option>
        <option value="11">10 Tickets = $150</option>
        </select>
        </div>

I wanted to use "alphanumeric values" but not sure how to go about this, that is why the Members Tickets are different, there is no additional coed linking to this field.

Can I number the values "0" for NONE then "1-10" for the tickets so when submitted it reads correctly? I have tried this but without turning the mandatory selection off on the Payment Method first, I can't submit the form to make it work?

Community
  • 1
  • 1
sampotts
  • 293
  • 1
  • 5
  • 15
  • In short:your saying that your not able to submit the form when the value for none is numbered as 0, and you dont want value 1 to be submit for guest tickets – dreamweiver Jul 29 '13 at 06:46
  • @dreamweiver - I would ideally want the Guest Tickets to read in the same way the Members does so its nice and clear as the recipients of the confirmation email need to know how many Member & Guest tickets have been purchased. Is there a way that the "payMethod" javascript can be changed from looking for a value ">= 2" to "1 Ticket or more" or can the values be changed so that "1 Ticket = 1" instead of the current 2? – sampotts Jul 29 '13 at 23:16
  • @sampotts- you can do one thing, at the server side (FormProcessv2.aspx) for interpreting no of guest ticket,just deduct the value by 1. so that when "None" value is selected, at server side you can deduct its value by 1 ,so that the final value will be 0 .this way you can interpret the actual number of tickets guest tickets booked by user . – dreamweiver Jul 30 '13 at 06:01
  • @dreamweiver - I don't have access to the Server Side files as the is hosted with Adobe Business Catalyst. Do you know of any other ways to get around this issue? Appreciate your help with this by the way. – sampotts Jul 31 '13 at 00:44
  • 1
    Then i that case, i guess you need to specify the value 0 for 'none' and 'please select option' . specify the value for tickets from 1-n and change the condition under toggle function of **payment method** to `$('#payMethod').toggle($(this).val() >= 1);` instead of value 2. I cant test the application as this rewuires submission of the form and thats not possible on jsfiddle. just try this once – dreamweiver Jul 31 '13 at 07:26
  • @dreamweiver - Thanks for that, looks like its working now. Can you make the above an Answer and I will vote it answered. – sampotts Jul 31 '13 at 23:04
  • @sampotts- thats good to know :) Happy Coding :) – dreamweiver Aug 02 '13 at 06:23
  • @dreamweiver - For some reason, my form is asking me for payment options and I dont believe I have changed anything at all. Any chance you could please look at the form http://www.faa.net.au/femmes/2013_events.html and tell me what is wrong? Do you need the code or can you see this by viewing the source? Feel free to attempt a submit on the form as it wont work any way. – sampotts Aug 23 '13 at 06:05
  • @sampotts- i guess there is something wrong in the validation part,can you just create a jsfiddle and let me know, i'll have a look at it – dreamweiver Aug 23 '13 at 08:46
  • @dreamweiver - Everything is the same as the previous JSFiddle you created except I have changed one value from 2 to 1 at the top as well as the values for the dropdown on Tickets, see updated JSFiddle - http://jsfiddle.net/4REan/3/ – sampotts Aug 25 '13 at 23:01
  • @Sampotts- let me check it – dreamweiver Aug 27 '13 at 14:03
  • Hey Sampotts, i guess you have solved this issue,sorry for the delay ,i was very busy – dreamweiver Aug 30 '13 at 13:19
  • @dreamweiver - I have removed the line of code that requires the field to be mandatory which isnt ideal but is allowing people to use the form at present. If you know how to resolve this that would be greatly appreciated. – sampotts Sep 01 '13 at 23:03
  • I feel that the mandatory option for the payment field should be set only when some tickets are checked, else the mandatory rule should be removed. this should be the proper way of doing it. if your finding it difficult to implement this, then let me know which line you have modified, i can fix it – dreamweiver Sep 02 '13 at 06:00

1 Answers1

1

I think you should specify the value 0 for 'none' and 'please select option' . specify the value for tickets from 1-n and change the condition under toggle function of payment method to $('#payMethod').toggle($(this).val() >= 1); instead of value 2.

Note :I cant test the application as this requires submission of the form and thats not possible on jsfiddle. just try this once

Happy Coding :)

dreamweiver
  • 6,002
  • 2
  • 24
  • 39