Custom Spry Validation... Multiple Select

http://www.mredkj.com/tutorials/tutorial005.html
I am trying to have a 'multiple' select box where the user would enter answers to a trivia question.  It is the same concept as the example in the link.
1.     User types answer in textfield
2.     Hit "add"
3.     javascript adds a new option in multiple select box with new answer.
Would it be possible using spry to validate that a user at least enters 1 answer?  Max of 3?  I appreciate any direction or suggestions on a new approach!

http://www.mredkj.com/tutorials/tutorial005.html
I am trying to have a 'multiple' select box where the user would enter answers to a trivia question.  It is the same concept as the example in the link.
1.     User types answer in textfield
2.     Hit "add"
3.     javascript adds a new option in multiple select box with new answer.
Would it be possible using spry to validate that a user at least enters 1 answer?  Max of 3?  I appreciate any direction or suggestions on a new approach!

Similar Messages

  • Custom F4 help multiple selection

    Hi folks,
    I have created a custom F4 help for select-options. it is working fine for low and high value selections. the moment i click onthe arrow multiple selections and enter multiple values and click on copy button it is giving short dump. how to handle this scenario.i tried to google but couldnt get for multiple selections. any thoughts on this?

    Hi,
    Please paste your code, for review.
    regards,

  • Custom Spry Validation

    Hi there,
    Its been a while since I was here, hope all is going well in the world of Spry? Any indications to the release of 1.7 yet?
    I currently have this custom JS for a form field:
    function checkDupeSerial(value)
        var duplicate = true;
        function validateSerial(ele)
            if(ele.innerHTML == value)
            duplicate = false;
        Spry.$$('td.serials').forEach(validateSerial);
        if(duplicate){
            var value = Spry.$('quantity');
            if(value != 1){
                value.value = 1;
        return duplicate;
    This does a couple of things, it checks whether the value entered is in a table cell. It then sets the quantity field to 1.
    Since I first wrote this (with the help from the good people here) I have changed the way the form works. I no longer need to change the quantity field to 1, thats easy to remove, and already have done in my live code.
    Before the serial field would only accept one serial number, but now it accepts more than one as long as it is seperated with a comma. What I now want to do, is to make sure the quantity field has the right number in it. So if there are three serial numbers entered and the quanity field only shows 2, it will automatically change it to 3.
    I think I need to count the comma's and add 1 to it, then set the quantity field. Could anyone give me some assistance with the counting part?
    Thanks in advance!
    Steve

    function checkDupeSerial(serial)
        var duplicate = true;
        function validateSerial(ele)
            if(ele.innerHTML == serial)
            duplicate = false;
        Spry.$$('td.serials').forEach(validateSerial);
        substrings = serial.split(',');
        var qty = Spry.$('quantity');
        qty.value = substrings.length;
        return duplicate;
    Well it was much easier than I thought, and works really well. As your typing the serial numbers it automatically increases the quantity.
    I hope this might help someone.
    Steve

  • Input Field with multiple selection

    I am planning to add an input field to my BSP application.
    I have already implemented a self-made F4 help for it.
    But now my customer wants a multiple-selection for it (as in the workbench, when you display the content of a database table).
    Is there anything I get for free, or do I have to implement this all on my own?

    Hi Daniel,
    Are you looking for implementation of select-options within BSP? For this you have a beautiful article by Thomas Jung... You look for it....
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/cd465292-0801-0010-e19f-e67172032668
    Thanks...
    Regards,
    Ravikiran

  • Spry Validation Select problem. It's not "sticking"

    Used Spry validation a few times, no big deal. Insert the widget, tweak, upload, done.
    I'm trying to validate one single drop down menu. I go to Insert, Spry Validation Select, I get the little blue "tab" thing attached to the drop down, and we're all good.
    I close the doc, open it back up and it's no longer there. You can click on the drop down menu, and no blue tab comes up for the spry.
    This doc is on a template, in an un-editable area.
    It seems to write the code to the page, you can find it if you look, but it's just not working.
    I know this is a long shot, but has anyone had this issue with Spry?
    I've been screwing around with this one doc for days trying to figure it out. I even went as far as pulling a backup copy that had never been "spry'd" before and starting over.
    Same result.
    A page that should have the spry working is:
    http://wolfe-florist-waco.com/online-flowers/ED-101.html
    Thanks.

    Suggest you start by cleaning up the code and validating the page
    http://validator.w3.org/check?uri=http%3A%2F%2Fwolfe-florist-waco.com%2Fonline-flowers%2FE D-101.html&charset=%28detect+automatically%29&doctype=Inline&group=0
    The link you posted is a page within a page (multiple Doctypes etc).
    Are you using Server Side Includes to pull code into the page? If so, the Include cannot be a self-contained page. It must be a code fragment only so that when it's pulled into the page, the resultant code forms a complete, valid web page.

  • Spry Validation Select ultimate beginner

    Hello to all,
    I need help with the spry validation select thingy.  Basically, I am not a programmer, so code stuff won't help me much.  I need a bit of a walkthrough:
    The problem:
    1) I need 2 validation select boxes with about 10 choices each.
    2) I need an activation button  - that is, when the correct choices are selected, the user presses a button to take them to the right webpage.
    3) I need the choices within each select box to (obviously) direct the user to a different page once the activation button is pressed.
    My solution so far:
    1) I can insert the 2 validation select boxes into dreamweaver, with what i think is the correct naming, etc.  I can also set the 10 choices for each.  I do not know what the "value" tab means in the "list values" button I use to name and set the number of choices.
    2) I can insert the button as well (just insert, nothing else)
    3) I am not able to link the 10 choices with anything - I simply don't know how to do that, and cannot find info about it.  When I live preview my work so far I get 2 nice drop/validation boxes with 10 choices each, and a button.  I now need to, given a specific choice and after the button is pressed, to take the user to a different webpage with information about the double selection they chose. 
    I hope the above is clear enough - in the end, I will have 100 seperate webpages that need to be linked to the choices (10 choices in one box times 10 choices in the other box), I just need a way to link those choices to the webpages.  Any basic and non-code based help would be very appreciated,
    Cheers,
    P

    I need help with the spry validation select thingy.  Basically, I am not a programmer, so code stuff won't help me much.  I need a bit of a walkthrough:
    You have got no hope!
    1) I need 2 validation select boxes with about 10 choices each.
    You have stated that you have already done this. The value of the select element can be found here http://www.w3schools.com/tags/tag_select.asp
    2) I need an activation button  - that is, when the correct choices are selected, the user presses a button to take them to the right webpage.
    You have stated that you have already done this
    Seeing that you have already done the above, these are no longer a problem. This leaves us with
    3) I need the choices within each select box to (obviously) direct the user to a different page once the activation button is pressed.
    For this we would need to see your markup in situ. Please supply a link to your site.
    Gramps

  • Spry Validation Selection - Required with Default Initial Selection

    Hello,
    I am using a Spry Validation Selection drop down.  I want the user to choose 1, 2, 3, or 4.  I would also like the drop down to initially say "Choose One"  I would like to force the user to have to choose 1, 2, 3 or 4.  Is this possible simply through Dreamweaver's edits? 
    Thanks,
    Melanie

    Yes, have a look at the following
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Untitled Document</title>
    <script src="SpryAssets/SpryValidationSelect.js"></script>
    <link href="SpryAssets/SpryValidationSelect.css" rel="stylesheet">
    </head>
    <body>
    <form action="" method="post">
      <span id="spryselect1">
      <label for="select1"></label>
      <select name="select1" id="select1">
          <option value="">Please choose one....</option>
          <option value="1">1</option>
          <option value="2">2</option>
          <option value="3">3</option>
          <option value="4">4</option>
      </select>
      <span class="selectRequiredMsg">Please select an item.</span></span>
      <input name="" type="submit">
    </form>
    <script>
    var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1", {validateOn:["blur", "change"]});
    </script>
    </body>
    </html>
    Gramps

  • Spry validation custom functions

    I see that there is a way to specify a custom function to a
    spry validation widget like so:
    var customFunction = new
    Spry.Widget.ValidationTextField("customPasswordFunction", "custom",
    {validation: passwordStrength, validateOn:["blur", "change"]});
    Is there a way to pass additional parameters to the function?
    I see that it passes (value,options) by default. I want to pass
    additional parameters to my custom function. Is this
    possible?

    I see that there is a way to specify a custom function to a
    spry validation widget like so:
    var customFunction = new
    Spry.Widget.ValidationTextField("customPasswordFunction", "custom",
    {validation: passwordStrength, validateOn:["blur", "change"]});
    Is there a way to pass additional parameters to the function?
    I see that it passes (value,options) by default. I want to pass
    additional parameters to my custom function. Is this
    possible?

  • Filtering A Dataset Using the Spry Validation Select Widget

    Given the code below, how can I filter the rows in the
    ds_BestConvertingByCategory dataset (in the spry:repeat area) that
    match the product category (prodcat_id) selected in the Spry
    Validation select widget?
    // product categories table: columns - prodcat_id,
    prodcat_desc
    var ds_ProductCategories = new
    Spry.Data.XMLDataSet("category_qry2xml.php", "product/category",
    {useCache:false});
    // has prodcat_id column
    var ds_BestConvertingByCategory = new
    Spry.Data.XMLDataSet("product_qry2xml.php", "special/deals[type =
    'Best Converting']", {useCache:false});
    // Spry regions inside a TabbedPanel
    <div class="TabbedPanelsContent">
    <form id="formOffersByCategory" class="frmsprysel"
    name="formOffersByCategory" method="post" action="">
    <strong>Select a Product Category: </strong>
    <span spry:region="dsProductCategories"
    id="spryselectProductByCategory">
    <select spry:repeatchildren="ds_ProductCategories"
    name="offersByCategory" id="offersByCategory"
    onChange="ds_ProductCategories.setCurrentRowNumber(this.selectedIndex);">
    <option spry:if="{ds_RowNumber} == {ds_CurrentRowNumber}"
    value="{prodcat_id}"
    selected="selected">{prodcat_desc}</option>
    <option spry:if="{ds_RowNumber} != {ds_CurrentRowNumber}"
    value="{prodcat_id}">{prodcat_desc}</option>
    </select>
    </span>
    </form>
    <div id="offersbycategory"
    spry:region="ds_BestConvertingByCategory"
    class="SpryHiddenRegion">
    <table id="offersByCategoryTbl" width="100%">
    <tr class="colhdr">
    <th width="50%">Offer</th>
    <th width="50%">Code</th>
    </tr>
    <tr spry:repeat="ds_BestConvertingByCategory">
    <td width="50%">{displaytext}</td>
    <td width="50%">{offer_code}</td>
    </tr>
    </table>
    </div>
    </div>
    // Spry validation select widget
    var spryselectProductByCategory = new
    Spry.Widget.ValidationSelect("spryselectProductByCategory");

    Hi flipone01,
    To do this, make your region depend on both
    ds_ProductCategories and ds_BestConvertingByCategory, then use the
    spry:test attribute in conjunction with spry:repeat to weed out
    items that don't have the same product id:
    <div id="offersbycategory"
    spry:region="ds_BestConvertingByCategory ds_ProductCategories"
    <tr spry:repeat="ds_BestConvertingByCategory"
    spry:test="{ds_BestConvertingByCategory::productcat_id} ==
    {ds_ProductCategories::productcat_id}">
    </div>
    Remember that if you make a region depend on more than one
    data set, you need to switch to using fully qualified data
    references as the example above does (using the :: notation). If
    you don't do that the data references default to the first data set
    in the spry:region attribute.
    --== Kin ==--

  • Spry validation select widget problem

    Dreamweaver CS3
    Im using spry validation for my form but the two spry validation select widgets I am using are not working. When I test them I keep getting errors that nothing has been selected when something has in fact been selected. I've used spry validation before with no problems but this is the first time using the spry validation select widget.
    My code:
    <tr>
                <td valign="top">Page in Question*</td>
                <td valign="top"><span id="spryselect1">
                  <label>
                  <select name="select1" id="select1">
                    <option selected="selected">Home</option>
                    <option>About Us</option>
                                </select>
                  </label>
                  <span class="selectRequiredMsg">Please select an item.</span></span></td>
              </tr>
              <tr>
                <td valign="top">Which Internet Browser do you use?*</td>
                <td valign="top"><span id="spryselect2">
                  <label>
                  <select name="select2" id="select2">
                    <option selected="selected"> </option>
                    <option>Internet Explorer</option>
                    <option>Firefox</option>
                    <option>Safari</option>
                    <option>Opera</option>
                    <option>Google Chrome</option>
                    <option>Other</option>
                  </select>
                  </label>
                  <span class="selectRequiredMsg">Please select an item.</span>              </span></td>
              </tr>
    Appreciate the help.

    Hi Daniel,
    Im having the same problem, can you please tell me what you did? I understand you found the problem?
    Thank you!

  • Validation of materials entered in multiple selection in selection-screen

    Hi,
    How can I do the validation for all the materials entered in multiple selection in selection-screen?

    What kind of validation do you need to do?
    One of the easiest options is to select the materials to an internal table and then loop through it. Something like this:
    SELECT-OPTIONS: SO_MATNR FOR MARA-MATNR.
    AT SELECTION SCREEN.
      SELECT MATNR FROM MARA
      INTO TABLE I_MATNR
      WHERE MATNR IN SO_MATNR.
      LOOP AT I_MATNR.
    "   <do validations here>
      ENDLOOP.
    Here table I_MATNR has only one field MATNR.
    But please be careful with this, because you might end up going through thousands of material numbers. You might want to limit the user's choices by making the field required and removing some other options. Also you can check number of records in I_MATNR and allow only, say, not more than 50 materials, thusly forcing the users to limit their selection criteria.
    Naturally, other selection options may be added here.

  • I want to validate multiple input type=text with spry validation any one hepl me?

    I want to validate multiple input type=text with spry validation any one hepl me?
    my code is as below plz help me
               *Professional Experience             Years        Months                             

    Read;
    http://labs.adobe.com/technologies/spry/articles/textfield_overview/index.html
    http://labs.adobe.com/technologies/spry/widgets/textfieldvalidation/SpryValidationTextFiel d.html
    and check out the samples:
    http://labs.adobe.com/technologies/spry/samples/

  • Multiple selection tab on Custom F4 of select option in report

    Hi folks ,
      how to get MULTIPLE SELECTION tab on extension of my selec option of report screen.
    If i pass Multiple_choice = 'X' in fm 'F4IF_INT_TABLE_VALUE_REQUEST' check boxes are appearing of each my f4 values when i press f4, i dnt want like this i want it my extension as Multiple selection as how it appears for standard 4 helps.
    <removed by moderator>
    Thanks,
    Shwetha
    Edited by: Thomas Zloch on Jan 7, 2012 10:32 PM

    Hi Clemen,
    Any selectin screens element(select-option) if we click on extension we will get a pop up window with  SINGLE VALUES,SELECT RANGES,EXCLUDE SINGLE VALUES, EXCLUDE RANGES bottome of this window we are having some icons along with it we have MULTIPLE SELECTION Tab.if we click on multiple selection tab we will be getting our all values with checkboxes each front of it so that we can select multiple vlaues at a time for the particular f4 .
    i want this multiple selection tab for my custome F4, iam not getting this MULTIPLE SELECTION tab.
    for example you can check for select-option of account group(T077D-KTOKD).
    in F4 function module if iam using paramter MULTIPLE_CHOICE = 'X', iam not getting the extension pop window with singlevalues, select ranges etc ., instead of it iam getting all my f4 fields with the checkboxes infront of each of it.
    please throw some light it is very urgent.
    please tell me iam using following parameters in function module please let me know if i need to use any other to get it..
    with the following if iam selecting multiple also i am able to see only last value in selection(inpopup window)
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = 'ATWRT'
          dynpprog        = sy-cprog
          dynpnr          = sy-dynnr
          dynprofield     = 'S_CHVAL1-HIGH'
          display         = c_sp
          value_org       = c_s
          multiple_choice = 'X'
          callback_program = sy-repid
        TABLES
          value_tab       = t_finals
          return_tab      = t_return4
        EXCEPTIONS
          parameter_error = 1
          no_values_found = 2
          OTHERS          = 3.
      IF sy-subrc = 0.
        READ TABLE t_return4." WITH KEY retfield = 'S_CHVAL1'.
        IF sy-subrc EQ 0.
          s_chval1-high = t_return4-fieldval.
        ENDIF.
      ENDIF.
    Thanks,
    Shwetha
    Edited by: swetha rishi on Jan 8, 2012 11:15 AM

  • Multiple Selections Disabled after validation

    Hi experts ,
    Couldsomebody please correct me on this :-
    I have a validation check for a select-option with NO Intervals.
    Any incorrect value in the Select option then an error message pops up . Now if there are multiple values in the Selct-option multiple selection then also the error popos up showing the wrong entires . But  when i try to change again i.e click on multiple selection then it doesnot allow the user to enter and correct those entries.
    Could you please let me know the best posible way to check teh above scenario ?
    Thanks
    Kylietisha

    Easy fix would be to remove the EL from the property. This makes the button accessible at all times.
    I guess the problem is that after the validation error you have to resubmit the data to make the commit button enable again. Try adding a button which doesn'T have an action or actionListener define on the page. After a validation error and the error is corrected click the new button and see if this enables the commit button again.
    Timo

  • Multiple selection customer field at header level... Is it possible?

    Y'all,
    I would like to know if it's possible to append a table into the include structure (CUF) at header level in the contract and create a search help screen with multiple selection values return.
    This requirement comes because we have to mantain a 1:N relationship between a contract and customer field at header level.
    If you have any idea or comment please let me know.
    Best regards,
    Jerry.

    Hi
    <u>I have not tried, but seems to be possible.</u>
    <b>Please go through the SAP OSS Notes -></b>
    Note 672960 - User-defined fields 2
    Note 762984 - SRM40-SUS: Implementation of customer enhancement fields
    Note 882256 - SRM-SUS: Customer fields for SUS invoice header missing
    Note 749196 - SRM40-SUS: SP01 Redefining UI settings
    Note 809628 - Table like customer fields from bid invitation in bid
    Note 809630 - Customer field in bid invitation and bid - How does it work?
    Note 458591 - User-defined fields: Preparation and use
    Hope this will help. Do let me know.
    Regards
    - Atul

Maybe you are looking for