Make any one of the Order Guide choices Mandatory

amacqueen
Mega Guru

We have an order guide that contains a series of variables for user information and then lists a series of accounts the user can request.

As things stand if the user doesn't choose an account and then selects the 'Choose Options' button it falls over so I need to find a way to force the user to select at least one of these accounts before they can select 'Choose Options'.

Any input gratefully received.

1 ACCEPTED SOLUTION

Your 'onSubmit' client script should be against the catalog item (the actual item/order guide), not on the Order Guide table.   Use the 'Client Scripts' related list at the bottom of your order guide form to add the necessary catalog client script.   If the related list isn't there, you'll need to personalize related lists to add it.


View solution in original post

14 REPLIES 14

If the choices are checkboxes use below code






if (g_form.getValue('AD Account varablename') == 'false' && g_form.getValue('item.OPUS varablename') == 'false' && g_form.getValue('item.PKMS varablename') == 'false' && g_form.getValue('item.CODA variablename') == 'false' && g_form.getValue('item.Vision varablename') == 'false' && g_form.getValue('item.TRF variablename') == 'false' && g_form.getValue('item.ACE varablename') == 'false' && g_form.getValue('item.TMS varaible name') == 'false' && g_form.getValue('item.E400 varablename') == 'false')


  {


  alert('Please select at least one account before continuing');


  return false;



}






If its fre form text use below code






if (g_form.getValue('AD Account varablename') == '' && g_form.getValue('item.OPUS varablename') == '' && g_form.getValue('item.PKMS varablename') == '' && g_form.getValue('item.CODA variablename') == '' && g_form.getValue('item.Vision varablename') == '' && g_form.getValue('item.TRF variablename') == '' && g_form.getValue('item.ACE varablename') == '' && g_form.getValue('item.TMS varaible name') == '' && g_form.getValue('item.E400 varablename') == '')


  {


  alert('Please select at least one account before continuing');


  return ;



}


Harish I now have an onSubmit client script on the Order Guide Table with the following script and it still isn't working:-



function onSubmit() {




if (g_form.getValue('adaccount variablename') == 'false' && g_form.getValue('opus variablename') == 'false' && g_form.getValue('pkms variablename') == 'false' && g_form.getValue('coda variablename') == 'false' && g_form.getValue('vision variablename') == 'false' && g_form.getValue('trf variablename') == 'false' && g_form.getValue('ace variablename') == 'false' && g_form.getValue('tms variaible name') == 'false' && g_form.getValue('e400 variablename') == 'false' && g_form.getValue('u_other_amendments variablename') == 'false')


  {


  alert('Please select at least one account before continuing');


  return false;}



}


Kalaiarasan Pus
Giga Sage

is the account a variable on the form or set of variables ?


The user details name, telephone number etc, are variables.



The accounts are part of the rule base and are order items each of which has a few (different variable)


Can't you add the account in a drop down variable and make it mandatory ?