AJAX/JSON functionality for Newsletter Subscription Form

Okay so we have Newsletter subscription form where we would like to implement this functionality using steps shown here - http://demo.businesscatalyst.com/json-form.
We used following code and it didn't work:
<script type="text/javascript">
                            function jqsub() {
                            var $f = $('#newsletter_signup');
                            var $m = $('#newsletter_form_result');
                            $f.find('.btn').prepend('<i class="icon-spinner icon-spin"></i>').addClass('disabled').attr('disabled', 'disabled');
                            $.ajax({
                              type: 'POST',
                              url: $f.attr('action') + '&amp;JSON=1',
                              data: $f.serialize(),
                              success: function(msg) {
                                var formResponse = eval(msg);
                                    if (formResponse.FormProcessV2Response.success) {
                                            $f.fadeOut(function(){ //Hide the form
                                                    $m.addClass('success').fadeIn().html("<p>Thank you for signing up to receive updates and offers.</p>");
                                error: function(msg) {
                                alert('error'+msg);
                                return false;
                            </script>
Then we noticed that user gets automated message and also we can see admin area that he has subscribed to newsletter, that means although there is no movement on the page, form gets submitted. That means the "if" argument is not working. That leads us to the question what would form newsletter subscription return upon submission - would it retuern "FormProcessV2Response"? Then we took off  "var formResponse = eval(msg);  if (formResponse.FormProcessV2Response.success)" and modified code as below.
<script type="text/javascript">
                            function jqsub() {
                            var $f = $('#newsletter_signup');
                            var $m = $('#newsletter_form_result');
                            $f.find('.btn').prepend('<i class="icon-spinner icon-spin"></i>').addClass('disabled').attr('disabled', 'disabled');
                            $.ajax({
                              type: 'POST',
                              url: $f.attr('action') + '&amp;JSON=1',
                              data: $f.serialize(),
                              success: function(msg) {
                                            $f.fadeOut(function(){ //Hide the form
                                                    $m.addClass('success').fadeIn().html("<p>Thank you for signing up to receive updates and offers.</p>");
                                error: function(msg) {
                                alert('error'+msg);
                                return false;
                            </script>
This code worked in terms of triggering fadding in and out animations, but now our concern is if this is a right way of tackling this issue. Would it be processed correctly when any error occured? Should we have any if argument similar to what we had in previous code?
If someone can guide us on this one, then it would be really great.
Thanks

Dear vora,
Its very simple, matter of adding simpel jQuery related code. I mean something like Ajax submitting form without page refresh and getting JSON response back.
For instance have a look over this example..
http://www.java4s.com/jquery-tutorials/submit-form-without-refreshing-page-in-javajsp-with -jquery/
Even the newsletter they are using is based on jQuery/JSON, in fact they applied through PHP, however you can use in any technology.
Regards

Similar Messages

  • MUSE & BC e-marketing subscription form

    I'm using MUSE as the underlying design for a website.
    The MUSE template has a lovely contact form - button is beautiful, changes states depending on mouse actions, completion/submission acknowledged... it's great.
    But - it isn't functional as a "subscribe" button to a newsletter...
    The BC e-marketing form is perfectly functional - and looks crude compared with the rest of the site.  Button is a plain box, doesn't change state, no indication that you are clicking something until the subscription is actually entered.
    How can I use the MUSE form as the basis for the e-marketing subscription?
    Any help is gratefully received.
    Linda

    Sydney:
    Thanks.  Please Compare:
    1.        the Contact US form on the site – this uses the MUSE version of the form which sends an e-mail with comments when filled out.   http://npgnew.businesscatalyst.com/contact-us.html
    When you hover over the “submit” button, the colour changes.  When clicked, it changes; when submitted it acknowledges submission….   I can’t figure out how to add the functionality to add the user to a subscription list in BC to this form.
    2.       The “subscribe to our newsletter” form on the site.  It’s on the home page, bottom right-hand corner.  http://npgnew.businesscatalyst.com/index.html   I created it from BC e-marketing and inserted the webform.  While it works, I can’t figure out how to get the button & messaging to work more like the form derived from the MUSE template (Serene is the template name, if that helps).
    Either modifying #1 to be functional for a subscription list or modifying #2 to be more user-communicative would be a solution.
    Thanks so much, Sydney.  Greatly appreciated!
    Linda

  • Is there a save function for online forms?

    Hi, I've created an online form which requests quite a lot of information from those who it is sent to.  Because of its size, I have made use of the skip logic rules to so that users can quickly skip sections that don't apply to them.  Notwithstanding this, the form asks questions which users may need to reseach and come back to so it wouldbe really useful if the form had a save function.  Does anyone know if such a function exists and if not, whether there are there imminent plans to develope one?
    If not, regreattably I will have to try and find another solution for online information gather that has a save and return function.

    hi randy
    I wholely support the request for a save feature for online forms, any idea of an ETA for this?
    Also to expand on this- the ability to print the  web form would be brillant.
    a few options for the  web forms submit to print, save.
    Web forms after/before  submission maybe to save as a pdf locally -  which then could be printed out.

  • How can I download a form in PDF without a paid subscription.  I am willing to pay for the subscription.

    How can I download a form in PDF which I just created without a paid subscription.  I am willing to pay for the subscription.

    Hi Ramesh,
    You're very kind.
    Thanks!
    Allan
    On Sat, May 2, 2015 at 2:05 PM, rjsivaraman <[email protected]>

  • Exist RFC Function or Bapi for insert Records form a external program?

    i create a Ztable same as tell me here:
    http://abaplovers.blogspot.com/2008/02/creating-table-in-sap.html
    5 String Fileds 2 Date Fields 2 Numeric Fields
    my question is exist a RFC Function or Bapi for insert Records form a external program (Delphi/Visual Basic)?
    Any advices?
    Thanks.

    hi madhurao123 thanks for answer.
    But Why block the Thread?
    This question is no so basic, yet never learn, the forum must be open to these questions maybe open a forum somewhere basic but must be able to do these basic questions.
    IT Toolbox commented the same thing, but if not here or ITtoolbox or where else can ask basic questions?
    Advise me, thank you.

  • Built-in functions for Forms in Oracle AS 10g

    Hi,
    We have recently installed form and report services for AS10g.
    Altough we have successfully converted and deployed static 6i forms to the server, the built in functions (like CALL FORM etc.) doesn't work.
    For instance a form is diplayed and is able to retrieve data but it does actually nothing when a button is pressed with underlying CALL_FORM, SET_WINDOW_PROPERTY functions.
    In our developer's devSuite these functions work fine, so I wonder if some service to be added to the server side.
    Any help will be appreciated,
    Thanks,
    Guney Hanedan

    If your development and target systems are different make sure you regenerate the FMX files...also make sure you have the correct case....in windows CALL_FORM('FormA') is will call a form called FORMA or ForMA or FORma..if you are deployed on unix or linux this will fail .
    REgards
    Grant Ronald
    Oracle Product Management

  • Post data into Ajax function for Item type plugin

    Please advise how to post data into Ajax function for item type plugin
    Edited by: Casufi on Jan 16, 2013 7:44 AM

    Casufi wrote:
    Casufi wrote:
    Please advise how to post data into Ajax function for item type plugin
    Edited by: Casufi on Jan 16, 2013 7:44 AMI used the following code
    var get = new htmldb_Get(null, html_GetElement(''pFlowId'').value, ''NATIVE='||apex_plugin.get_ajax_identifier||''', $v(''pFlowStepId''));
    get.addParam(''x01'', node.data.key);
    gReturn = get.get();You should use this published true ajax API instaed. apex.server.process( pAjaxIdentifier, pData, pOptions )

  • Using BC Form for Newsletter Signup on 3rd party platform

    I am working with a client who has a 3rd party online store, but their website is hosted on BC platform. I need to provide the newsletter signup form code to the other dev team so they can recreate the form to allow customers to signup for the newsletter while shopping in the the new online store. Is there any documentation on this? It seems that the .js files are BC specific.
    The form is making a call to "/CampaignProcess.aspx?ListID=27563". This does not exist on the site and the 3rd party developer needs access to that actual aspx file or have the full URL path?
    The form also makes a call to "/CatalystScripts/ValidationFunctions.js". This does not exist on the site and the 3rd party developer needs access to that actual aspx file or have the full URL path

    Mario,
    I appreciate your response, but I'm not quite sure I understand your
    proposed solution.  I get an error when using that URL -- *ERROR: Email
    address could not be added to list.*
    Sean Garcia | BayouFire Media, LLC | [email protected]
    <[email protected]> | 985-807-3931 | Building Dynamic Online
    Businesses | bayoufiremedia.com
    On Thu, Aug 21, 2014 at 7:24 PM, mario_gudelj <[email protected]>

  • Additional functions for form creation

    Is there any additional functions for selecting members for forms.
    For example ILvl0Descendants used to be hidden and if you knew the syntax you could type it in. Now of course it is an option but wondering if there might be others that are still hidden but work.
    Specifically I want to use @UDA but if there are others they might fufill my needs.
    Ultimately kind of annoying that forms don't allow for all the standard functions available in Planning and Essbase

    Hi,
    You can't currrently (11.1.1.3) use UDA, the current list is :-
    Member
    Descendants
    Descendants (inc)
    Ancestors
    Ancestors (inc)
    Siblings
    Siblings (inc)
    Parents
    Parents (inc)
    Children
    Children (inc)
    Level 0 Descendants
    DTS (e.g. Y-T-D)
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How can I create a custom button for opening a form?

    I have a parent form having child forms. In my main form I want to create custom buttons for opening child forms. I want to use master-detail form but there are more than one child forms, and in master-detail form I can only create one detail form. So I will create a form based on a table and in that form I will call the child forms by custom buttons. Can I do that?
    Thanx,
    Gulsah.

    This can be easily done. First open up two instances of your Portal. In one window, you will need to go into your component you wish to link FROM. In the other window you will need to go into your component you wish to link TO. In the component you wish to link TO there will be a moduleid. Note this somewhere. Then, you will see an area that says: "Call Interface: Show". Click on this. (In the window you are linking to.). In this window, you will see a bunch of stuff. At the bottom you will see a URL call. This is the call you need to use. At the top, it explains each piece of the URL call. Just subsitute YOUR appropriate information into the URL call. In the form you wish to link FROM, create a button. Once you create this button, it will appear at the bottom, click on it and you will see an area to insert a Javascript. Click the onClick and insert:
    //this is the variable you want to pass from one form to the other
    get_field_name = getField(this.form,'COLUMN_NAME_IN_DATABASE');
    //this is so you can open the "child" form
    window.open('/pls/cc_prod/DAD_NAME.wwa_app_module.link?p_arg_names=_moduleid&p_arg_values=MOD_ID_HERE&p_arg_names=_sessionid&p_arg_values=&p_arg_names=COLUMN_NAME_IN_DATABASE&p_arg values='+GETFIELD_NAME+'&p_arg_names=_COLUMN_NAME_IN_DATABASE_cond&p_arg_values=%3D');
    In the fourth tab, where it says, "....before displaying form" insert the following: (This will tell the form how to handle the getField function.)
    htp.p('<script language="JavaScript1.3">
    < !--
    function getField(form,fieldName)
    var objName = "";
    var tmp = "";
    var dAction = "";
    var sel_idx = 0;
    var cnt = 0;
    var instance = 0;
    var slicedName;
    var fillData = new Array();
    for (var i = 0; i < form.length; i++)
    slicedName = form.elements.name.split(".");
    tmp = slicedName[2];
    instance = parseInt(slicedName[3],10);
    if (!tmp)
    continue;
    objName = tmp;
    if (objName == fieldName)
    return form.elements[i].value;
    //-->
    </script>');
    I hope this helps.
    null

  • Best Practice for re-usable forms in multiple Countries

    Dear experts,
    i'm seeking for suggestions about the best design which could help saving time on development for multiple forms i should produce for a multi-national client.
    In more details, the client is asking to create a number of forms in the SD area (Order advice, delivery note/Bill of Lading, Payment slips and in particular Billing outputs) for different Countries in North and South America.
    I'm striving to avoid creating separate forms for separate Countries, as ideally i'd want to create just one form per type (i.e. one form for Billing, one form for Delivery note...) and re-use the same forms for all Countries, where specific data should differ from one Country to the other.
    We've been working on similar topics in the past, adding some logic behind some texts which we've made "parametric", meaning different standard texts are printed in the same box depending on some organizational values (i.e. sales organization or company code), but we're looking for something "smarter", where having different pricing structures in different Ctries, for instance, might still work if those Conutries use the same billing form
    Is there any best practice you'd like to share with me with regards to this? Is there any new functionality SAP has delivered recently which helps in this direction?
    Many thanks to all who will want to reply to my weird question.
    Regards,
    Fabio

    Hi Scott.
    Storing two columns of spatial data is fine in SQL Server. And you are correct that there is no built-in reprojection in SQL Server, most folks do that as part of data loading. There was talk of porting parts of ogr2ogr to SQLCLR, but I don't think anyone
    did that.
    Cheers, Bob

  • How to save the session states for a tabular form WITHOUT using check boxs?

    Greeting guys,
    As you know that we can use collections to save the session states of a tabular forms, described in the how-to doc of manual tabular forms. However, what I am trying to do ( or have to do) is to provide a manual tabular form, and save the session states for validation, without using the check boxes. Because a user can put contents into some columns in a row without checking the corresponding checkbox, according to the requirements. So basically what I tried is to loop over all the rows and save Every entry into a collection. However, sometimes I got "no data found" error with unknown reasons.
    My current solution is to use the "dirty" Retry button that gets back the history, which IMO is not a good workabout. So, I'd appreciate if somebody can shed some light on a better solution, especially if it is close to the one in that how-to doc.
    Thanks in advance.
    Luc

    The following is the first collection solutin I've tried:
    htmldb_collection.create_or_truncate_collection('TEMP_TABLE');
    for i in 1..p_row_num loop -- Loop on the whole form rows
    if (htmldb_application.g_f01(i) is not null) or (htmldb_application.g_f05(i) <> 0)
    --If either of them has some input values, the row should be saved into the colleciton.
    then
    htmldb_collection.add_member(
    p_collection_name => 'TEMP_TABLE',
    p_c001 => htmldb_application.g_f01(i),
    p_c002 => htmldb_application.g_f03(i),
    p_c003 => htmldb_application.g_f04(i),
    p_c004 => htmldb_application.g_f05(i),
    p_c005 => htmldb_application.g_f06(i),
    p_c006 => htmldb_application.g_f08(i)
    end if;
    end loop;
    Some of columns have null values, but I don't think that's the reason. Because once I clicked all the check boxes, there would be no error no matter what values were in other columns.
    Another issue would be extract the values FROM the collection, which has been tried because I had problem to store the data into the collection. I used "decode" functions inside the SQL to build the tabular form. I am not sure whether it will be the same as a regular SQL for a tabular form, like the example in the How-to doc.
    Also I didn't use the checksum, for it is not an issue at the current stage. I am not sure whether that's the reason which caused the NO DATA FOUND error.

  • Integrating newsletter submission form into adobe muse (with business catalyst hosting)

    Hi,
    I have seen some posts on this question but i don't quite understand how i should go about this. I have created a form, for my newsletter, in muse which fits the style of my website, i would like to use this form to automate a response when someone signs up to it. Will the visitors details be stored on the business catalyst CRM database? Any help would be appreciated.
    Lewis

    Hello Lewis,
    Visitors details will be stored on Business catalyst. I found a video, that shows how you can add the BC modeules in Muse, and customize it, it is using News section for example, this will give you an idea, how you can do this for Newsletter
    Please let me know if you have any other query.

  • How to Multi Row Update function in Manual Tabular Form

    Hi All,
    In my application I am using manual tabular form, for Update and insert i have written pl/sql process,
    but i want to make use of MULTI_ROW_UPDATE function for update and insert operations.
    How can I implement default tabular form behaviour in manual tabular form.
    I am using:
    Oracle Database 11g
    ApEx Version 4.0
    please help me, it's urgent.
    thanks
    MR

    Hi Joao,
    First Can u pl let us know your view is based on how many
    tables?
    If it is a simple view ,you can open the form in update mode
    passing a parameter to it thru a procedure or thru a url or what
    ever you feel like(form to form,etc)..I will give you an example
    on how to open the form in update mode like below..
    1.develop a form based on a simple view
    2.Call that form Thru a simple URL
    3.In the above you are opening a form with module id
    ex:1234567890 in update mode and change portal30 to suit
    accordingly..
    4.You are passing a parameter called "ABCDEF" TO "NAME" Field to
    that form for querrying..
    5.Now the form will be opened in update mode and all the fields
    are pertaining to the parameter "ABCDEF" and you can update the
    fields....
    II..Now regarding the check boxes i need to know which version
    of the portal are u using..As for as my knowledge goes (up to
    3.0.6) there are lot of bugs with the check boxes and check box
    checked value is always "yes"(if u want to insert in to the data
    base).So try not to depend on checkboxes and instead Combo is
    the right answer till oracle portal is free of bugs.
    No triggers are required for your requirement....
    Hope i have answered your problem ...If any please revert back
    with full details
    Thanks
    Vishnu Singireddy

  • Delete Functionality in manual tabular form

    Hi everyone,
    I have created 2 tabular forms on the same page.everthing is working fine.Both the tabular form are able to insert and update.I am getting problem to implement the DELETE functionality in those tabular form.
    I inserted this code htmldb_item.checkbox(6, id) del in the region and i created a delete process.But i am getting (no data found) error.
    could anyone help me in solving this.
    thanks
    phani
    ===========================================================
    DELETE PROCESS:
    FOR i in 1..HTMLDB_APPLICATION.G_F01.count
    LOOP
    DELETE FROM (TABLE NAME)
    WHERE id = HTMLDB_APPLICATION.G_F06(i);
    END LOOP;
    =============================================================
    TABULAR FORM 1:
    REGION:
    select x.column1,
    x.column2,
    x.column3,
    x.column4,
    x.column5,
    x.del,
    x.cks
    from (
    select htmldb_item.hidden(1,column1) column1,
    htmldb_item.text(2,column2,10) column2,
    htmldb_item.text(3,column3,10) column3,
    htmldb_item.text(4,column4,10) column4,
    wwv_flow_item.date_popup(5,null,column5) column5,
    htmldb_item.checkbox(6,column1) del,
    htmldb_item.md5_checksum(column2,column3,column4,column5) cks
    from TABLENAME
    union all
    select htmldb_item.hidden(1,null) column1,
    htmldb_item.text(2,null,10) column2,
    htmldb_item.text(3,null,10) column3,
    htmldb_item.text(4,null,10) column4,
    wwv_flow_item.date_popup(5,null,null) column5,
    htmldb_item.checkbox(6,null) del,
    htmldb_item.md5_checksum(null,null,null,null) cks
    from dual) x
    ==================================================================
    PROCESS:
    declare
    l_cks wwv_flow_global.vc_arr2;
    j pls_integer := 1;
    begin
    -- Get original MD5 checksum
    select wwv_flow_item.md5(column2,column3,column4,column5) cks
    BULK COLLECT INTO
    l_cks
    from TABLE;
    -- Compare the original checksum, l_cks,
    -- with submitted checksum, htmldb_application.g_fcs.
    -- If they are different, raise an error.
    -- for i in 1..l_cks.count
    -- loop
    -- if htmldb_application.g_fcs(i) != l_cks(i) then
    -- rollback;
    -- raise_application_error(
    -- -20001,
    -- 'Current version of data in database has changed '||
    -- 'since user initiated update --process.');                      
    --return;
    -- end if;
    -- end loop;
    -- update
    for i in 1..htmldb_application.g_f01.count
    loop
    if htmldb_application.g_f01(i) is not null then
    update TABLENAME
    set column2= htmldb_application.g_f02(i),
    column3 = htmldb_application.g_f03(i),
    column4 = htmldb_application.g_f04(i),
    column5 = htmldb_application.g_f05(i)
    where column1 = htmldb_application.g_f01(i);
    else
    if htmldb_application.g_f03(i) is not null then
    insert into TABLE
    (column2,
    column3,
    column4,
    column5
    values
    (htmldb_application.g_f02(i),
    htmldb_application.g_f03(i),
    htmldb_application.g_f04(i),
    htmldb_application.g_f05(i));
    end if;
    end if;
    end loop;
    end;
    I created the other tabular form on the same page with
    htmldb_application.g_f11(i)
    htmldb_application.g_f12(i)
    htmldb_application.g_f13(i)
    htmldb_application.g_f14(i)
    used the same code.

    Have you got any response on this? I would like to know how to do it too. I am trying to implement a manual tabular form on a page and need this functionality.
    I do know one thing. After attending the ODTUG conference last week, Raj said something about you have to process check boxes and radio groups separately from the rest of the form.
    Thanks,
    Michelle

Maybe you are looking for

  • IPod transfering podcasts to iPod it shouldn't be

    iTunes transfers all of my podcasts to my 2nd Gen iPod Nano, regardless if I specify 1, 3, or 5 "most recent" podcasts or even completely disable podcast syncing altogether- The podcasts that are not supposed to be syncing to the iPod cannot be playe

  • Equivelant of "virtual function" from C++ in Java?

    I have a Java class which implements a network protocol. There are certain types of packets that my Java class will handle internally. Then again there are other types of packets my Java class needs to pass on to the Java MIDlet that is running this

  • IP SLA with EEM

    Hello, I have a router running IOS version 15.3(3)M2 with the below configuration.  The intent is for the router to shut down it's WAN interface in the event that it is unable to successfully ping the internal IP 192.168.1.1.  Is there a way I can ha

  • Lightroom 2 Catalog Previews

    I am running LR3.3. I am doing some housecleaning, and I've found this folder: C:\Documents and Settings\My Name\My Documents\My Pictures\Lightroom\Lightroom 2 Catalog Previews.lrdata\ It looks like something that was abandoned during an upgrade, and

  • Preview Mode Thumbnails showing up Blank

    PLEASE HELP. Some thumbnails of pages in Preview Mode are showing up as blank. I have tried... 1. Restarting Muse 2. Re-Opening the document 3. Turning thumbnails on/off in Preview Mode 4. Opening those specific pages, making edits, then closing them