Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 92406

Re: How can I restrict multiple web app item submission by a user

$
0
0

Hi Chad, am having challenges getting this to work: Kindly assist

 

This is my setup:

 

I used the alternate list layout. This is how it looks

Web Apps  Test   submit webappitem once.png

 

This is how my form page with the module looks before running:

 

Pages  bctest useradditem form  Live Page .png

 

 

This is how the spit out looks when I checked:

 

This is the source code after running:

 

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

<script type="text/javascript">

 

 

$(function(){

 

 

var userSubmit = $('.userItems').data('items').replace(/\s+/g, '');

if (userSubmit >= 1) {

    $('.form').remove();

 

 

});

 

 

</script>

<style>

            .hide {

            display: none;

            }

        </style>

</head>

<body>

 

 

   

        <div class="hide userItems" data-items="1

2

3

"></div>

        <div class="form">

        <form name="catcustomcontentform17626" onsubmit="return checkWholeForm17626(this)" enctype="multipart/form-data" method="post" action="/CustomContentProcess.aspx?CCID=20247&amp;OID=13466153&amp;OTYPE=1">

            <table class="webform" cellspacing="0" cellpadding="2" border="0">

                <tbody>

                    <tr>

                        <td><label for="ItemName">Item Name</label><br />

                        <input class="cat_textbox_small" type="text" name="ItemName" id="ItemName" maxlength="255" /> &bull;</td>

                    </tr>

                    <tr>

                        <td><label for="ItemDescription">Item Description</label><br />

                        <textarea name="ItemDescription" id="ItemDescription" cols="10" rows="4" class="cat_listbox"></textarea></td>

                    </tr>

                    <tr>

                        <td><input class="cat_button" type="submit" value="Submit" id="catcustomcontentbutton" /></td>

                    </tr>

                </tbody>

            </table>

            <script type="text/javascript" src="/CatalystScripts/ValidationFunctions.js"></script>

            <script type="text/javascript">

//<![CDATA[

var submitcount17626 = 0;function checkWholeForm17626(theForm){var why = "";if (theForm.ItemName) why += isEmpty(theForm.ItemName.value, "Item Name");if (why != ""){alert(why);return false;}if(submitcount17626 == 0){submitcount17626++;theForm.submit();return false;}else{alert("Form submission is in progress.");return false;}}

//]]>

</script>

        </form>

        </div>


Viewing all articles
Browse latest Browse all 92406

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>