Using javascript in a Web app to choose correct webform

Hi, I've design a javascript function that should in theory call the correct webform when a particular option is chosen in a webapp item.
The web app is an Event Web App that I made and I want the client to choose whether its a paid event or a free event from a drop down menu and the corresponding webform will appear.
Javascript and webforms just seem to hate each other.
My code is :
<h1>{tag_name}</h1>
{tag_description}
<div id="event">{tag_event type}</div>
<script type="text/javascript">
var str=document.getElementById("event").innerHTML;
var n=str.replace("Paid","45008").replace("Free", "10254");
document.getElementById("event").innerHTML= '{module_webform,'+n+'}';
</script>
I know the script should work because I tested it using random words and the string would appear but when I actually put the webform number in
firebug shows this error:
<script type="text/javascript">
var str=document.getElementById("event").innerHTML;
var n=str.replace("Paid","45008").replace("Free", "10254");
document.getElementById("event").innerHTML= <!-- CATALYST_ERROR - There was a problem with page modules. Ensure module syntax is correct. -->
</script>
Anyone have a solution?

Hello ChristoRay,
I'm curious to know if you have got this working? I have not tested this out, but I wouldn't think that you could use JavaScript to dynamically change a module.
I would think that you could just create a drop down for them called "Free10254 or Paid45008" with the numbers being the values they select.
Then within the details layout you can have:
{module_webform,{tag_free10254 or paid45008}}
This would cut out the need for js.
Hope this helps,
Chad Smith | http://bcgurus.com/Business-Catalyst-Templates for only $7

Similar Messages

  • Use blog module or web apps for Blog posts?

    We are considering whether or not we should use a web app or continue to use the blog module for our client's blogs.
    Is anyone using web apps for their blogs, and if yes, what is your feedback on it?
    Or could someone tell me if BC will fix the blog problems (in regards to SEO) within the next 12 months?
    Thank you.

    Bc Blog can still do well seo wise. Many get to OTT in that regard I feel.
    Blog I hope gets fixes but a web app just does not quite offer the features at this stage to make a good blog. Not till the new web app engine next year.

  • How to use isotope to filter web apps?

    Hi,
    I just want to ask on how to use isotopes jquery plugin to filter the web app entries by categories?
    Thanks.
    Hernan

    Hi sb00349044,
    I am locking this question since it's a duplicate from your other post:
    * [https://support.mozilla.org/en-US/questions/1025653]
    Development related questions are not in the scope of the SUMO forums. Although it's possible that some contributors may be knowledgeable about developing for Firefox OS, and may offer some suggestions, these forums are aimed at assisting users with assisting end-users of Firefox OS.
    As I mentioned in your other post, por developer-related questions, you may have better luck finding help through MDN (Mozilla Developer Network) and StackOverflow. You can find these links below:
    * [https://developer.mozilla.org/en-US/ Mozilla Developer Network]
    * [https://developer.mozilla.org/en-US/docs/Web/API/Web_Bluetooth_API WebBluetooth API on MDN]
    * [http://stackoverflow.com/questions/tagged/firefox-os Firefox OS on StackOverflow]
    You may also send your question to one of Mozilla's Mailing Lists that are related to this topic. Please find the mailing lists on the link below:
    * [https://lists.mozilla.org/listinfo]
    Thanks,
    - Ralph

  • Does Firefox allow use of full Outlook Web App for e-mail. If yes how do I switch from light to full?

    My e-mail is available throuhg Outlook Web App for microsoft Exchange and since I chose Firefox as my default browser I can only get the light version. Does Firefox not support the full version of Outlook Web App for windows 7

    Firefox simply tells the operating system to use the default mail client, so whatever the default is, that will be used.

  • Where to put JAAS classfiles (loginmodules) when using it from a web app

    Hi,
    I am using JAAS authentication from a web application, the problem is that the login modules that I use, and all the classes that the LoginModule uses are not loaded from the WEB-INF/classes or WEB_INF/lib folder. I have to put them on the jdk/jre/lib/ext. The problem is that the classes I put there collide with other applications that use the same installed JDK.
    I have developed it using jdk1.3.1 and JAAS 1.0.
    Is there a way to put specify where login module classes should be loaded that does not interfere with other applications (that is, I do not want to put any class on the jdk/jre/lib/ext folder).
    Cheers

    Unfortunately, the only alternatives are to put all resources required by JAAS in jre/jre/lib/ext OR on the system classpath when the JVM is started.
    This is apparently due to a bug in JAAS. The implementers of JAAS have the LoginContext written so that it loads resources only from the system classpath. Unless this was, for some reason intentional. I don't know what the plans are for JAAS going forward with respect to this.
    Has it been fixed in J2SE 1.4?
    I'll have you know this wreaks havoc with attempting to have your LoginModule use an EJBs to authenticate a user and add Principals to the Subject.

  • Can I cluster a web app that uses Spring and iBATIS?

    I have a web app that uses Spring and iBATIS. It runs great on a single server. I am now trying to get it to run in a cluster. I went through the code and made all the classes serializable. Also, I added the distributable tag to the web.xml. I then deployed it to two clustered app servers.
    When I logon and use the web app, everything goes well. Then, as a test, I determine which app server is being used and stop the web app on it. As I try to continue my session, the following exceptions are generated from the other node:
    java.lang.IllegalArgumentException: No SqlMapClient specified.
    The exception is being thrown from the Spring code. Is there something else I need to do to get Spring and iBatis to work in a clustered environment.
    Also, I see a lot of references to Terracotta as a clustering solution. Will Terracotta work with Oracle App Server?

    Thanks for the response.
    I think my session information is being shared. I've configured the default application in my OC4J configured for peer-to-peer clustering. Before I did this, if I shut down the instance I was using, it would fail-over to the other application server but my session would be gone and I would be forced to logon again. But once I was logged on, everything ran smoothly.

  • Can't use {tag_itemid} in web app detail layouts

    Hey gang,
    I was trying to help someone implement a rating star system for their web app items and they wanted the ratings widget also to appear in the detail layout but for the widget to work they needed each item to have a unique id.  It works fine for them in the list layout but the {tag_itemid} does not render in the detail layout. This is a third-party star ratings widget/service so they store the rating data on another server and each time they show the ratings widget it needs to be tied to a unique id.  I suggested adding a "uniqueid" field to their web app but they intimated that having the client add/update a new uniqueid for each item (of which they have thousands) would be unmanageable.
    I think this is a bug.  Is there a reason we can't use {tag_itemid} in the web app detail layout?

    brilliant!
    what is the usual timeline for a sprint Mario lol?
    Defintely agree with Liam in that most of the tags/module tags for both the list and detail layouts should be universal as there are some situations where you need to use the tags dynamically to create outputs that need to be shown in both...
    for example
    I'm using a polldaddy rating system for a webapp currently and to get it to show up on each listing item separately requires a unique ID so using {tag_itemid} made perfect sense as it wouldnt break any polldaddy coding... however I cannot call the same rating system into the detail page (where it would logically be repeated) because I cannot replicate the same ID with no {tag_itemid} availble.
    Asecond example is:
    Since we had managed to put a readers upload gallery into a nice compact layout in the list layout using litebox and the ?Action=thumbnail feature the client really wanted to keep the photo gallery commenting system simple aslo (not to many steps) so ideally we would have liked to only ustilise the list-template and put the comment feedback tag in a sliding div (to show & hide it) so that readers could stay on one list page... but once again this wasnt possible becuase the {module_ratingfeedback} was not available in the list view (forcing us to make them click through to the detail page).
    FYI: heres a sample link to what we had to put together in the end for the above - still slightly in development
    http://www.nzhunter.co.nz/test-gallery
    Anyway I think you get the idea - more flexibility and universal usage options for tags/module calls would be great.
    Look forward to the updates at some point.

  • Claims debacle (error) with Term Store: "Could not retrieve a valid windows identity" for all sites in a particular web app.

    When I pull up the Term store in CA or any MySite collection, it works.
    When I do so in any other site collection (HNSCs, incidentally), It doesn't return any term stores.
    My ULS log immediately before and after the "/_vti_bin/taxonomyinternalservice.json/CheckPermission" POST on termstore .aspx triggers the WCF call:
    Claims Authentication af30y Verbose Claims Windows Sign-In: Successfully signed-in the the user 'contoso\domainUser' for request url 'https://sp13-root-prd.contoso.com/_vti_bin/taxonomyinternalservice.json/CheckPermission'.
    Claims Authentication af30q Verbose Updating header 'LOGON_USER' with value '0#.w|contoso\domainUser' for the request url 'https://sp13-root-prd.contoso.com/_vti_bin/taxonomyinternalservice.json/CheckPermission'.
    Authentication Authorization agb9s Medium Non-OAuth request. IsAuthenticated=True, UserIdentityName=0#.w|contoso\domainUser, ClaimsCount=77
    Logging Correlation Data xmnv Medium Site=/
    Topology e5mc Medium WcfSendRequest: RemoteAddress: 'http://CONTOSOFE3:32843/00e6d55691824965ac223f1d1cfae6d2/MetadataWebService.svc' Channel: 'Microsoft.SharePoint.Taxonomy.IMetadataWebServiceApplication' Action: 'http://schemas.microsoft.com/sharepoint/taxonomy/soap/IDataAccessReadOnly/GetChanges2' MessageId: 'urn:uuid:590e916c-c89a-4f89-9819-a82c97fabcaa'
    Claims Authentication bz7l Medium SPSecurityContext: Could not retrieve a valid windows identity for username 'contoso\domainUser' with UPN '[email protected]'. UPN is required when Kerberos constrained delegation is used. Exception: System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: WTS0003: The caller is not authorized to access the service. (Fault Detail is equal to An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is: System.UnauthorizedAccessException: WTS0003: The caller is not authorized to access the service. at Microsoft.IdentityModel.WindowsTokenService.CallerSecurity.CheckCaller(WindowsIdentity callerIdentity) at Microsoft.IdentityModel.WindowsTokenService.S4UServiceContract.PerformLogon(Func`1 logonOperation, Int32 pid) at SyncInvokeUpnLogon(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet))..
    Claims Authentication g220 Unexpected No windows identity for contoso\domainUser.
    The "The caller is not authorized to access the service." message seems pertinent.
    Both web apps are using only NTLM auth.
    The url for both web apps ends in the same contoso.com domain. 
    I get the same errors no matter what account I use, including the install account.
    Things I've tried:
    Deleting and building a new HNSC root web app and site. Error happens in all sites in all web apps except the PBSC hosting MySites.
    Giving the root site app pool identity full control of the metadata service app (even though the MySite identitiy doesn't have it)
    Giving the root site app pool identity full permissions on the metadata service app.
    Comparing database and web app config permissions between dev (where everything works perfectly) and prod (where it does not).
    Made sure IIS auth settings on both sites are identical
    Both sites are using the same SSL certificate (though the call to the web service appears to be http)
    Reprovisioned the metadata service app with a new database and new app pool identity.
    Made sure C2WT is running. Tried it with the service stopped as well.
    Web.configs are identical between working and non-working apps.
    I'm stumped but still Googling. I'm hoping to avoid having to call Micrososft. Any help would be appreciated!
    UPDATE:
    Interestingly, when I restored the web application from backup (via CA), I ended up with 3 identical "Windows Authentication" authentication providers assigned to the problem web app. Since there was more than one, I was directed to the provider-chooser
    page when visiting the site. Upon choosing 1 of the 3, I was authenticated, and *poof*, no more authentication errors and the term store loaded term sets as expected.
    Of course, 3 providers was not an ideal state, so I grabbed the one that worked (#1) via get-spauthenticationprovider, and assigned it to the web app via set-spwebapplication, and my problem returned.
    I am currently updating the farm to SP1 from June 2013 CU. Fingers crossed.
    Update:
    The update to SP1 went smoothly, but did not resolve the issue. Also related (I believe) are the random authentication errors when trying to upload images to some libraries, and 401-errors on the accessdenied.aspx page itself.
    Update:
    The problem is resolved, seemingly after making 4 changes. I'm trying to narrow down which change was the cure, if any:
    I installed SP1 on all 6 servers, rebooted and upgraded. This appeared to have no effect.
    Removed an old login from SQL that no longer existed in AD because of this ULS error:
    System.Runtime.InteropServices.COMException: The user or group contoso\svc_xxxxxxxxx' is unknown., StackTrace:    at Microsoft.SharePoint.Utilities.SPUtility.GetFullNameFromLoginEx(String loginName, Boolean&
    bIsDL)
    This login was the identity of the application pool that used to run the web app in question.
    This login was the schema owner of a schema named after itself on every SharePoint database so I changed the schema owner to dbo but left the schema attached.
    The problem may have surfaced initially when the app pool identity was changed in CA, but went unnoticed?
    Note that the web app had been deleted and recreated many times with a new identity and pool to no avail, but the URL remained the same throughout each attempted fix. Relevant?
    Grasping at straws, I changed the app pool identity for this web app to the same one that runs the MySite web app pool as per this only slightly related problem: http://www.planetsharepoint.org/m/preview.php?id=372&rid=34764&author=Vlad+Catrinescu
    I changed the authentication method from NTLM to Negotiate.
    I am rolling back #3 and #4 to see if the issue resurfaces.
    Update:
    It doesn't appear to have been the NTLM/Negotiate setting. Web app is currently set to NTLM and all is well. No strange accessdenies, and term Store is still manageable from all sites.
    Update: Sorry for the delay. I am administering 6 farms these days. Will update as soon as the final phase of rollbacks happens.
    I think I can. I think I can.

    maybe that web app was accidentally created with classic auth?
    here's an example of how to create claims based, with classic, and then "doing 2013" claims
    #Create the example web application, as mentioned above, either with gui, and pick later, or
    New-SPWebApplication-ApplicationPool$applicationPool-ApplicationPoolAccount$serviceAcct-Name$WebApp-Port
    5050
    -databaseName$contentDB-securesocketslayer
    #If doing for 2013
    New-SPWebApplication-ApplicationPool$applicationPool-ApplicationPoolAccount$serviceAcct-Name$WebApp-Port
    5050
    -AuthenticationProvider(new-spauthenticationprovider)
    -databaseName$contentDB-secureSocketsLayer

  • Lync 2013 Web App Sharing not working.

    We are having a problem with Lync Web App 2013.  Our external customers can open the meeting link and join the meeting without a problem.  Once they are in the meeting an internal user begins the presentation by sharing his screen.  The Lync
    Web App just says "Loading..." for the external customer.  The internal presenter sees this external customer continually change from "in collaboration session" to "not in collaboration session".  The external customer
    is never actually shown the screen share.
    Other notes:
    -->We tried this from an external wireless hotspot and it worked fine, thus, it seems something in this customer's company firewall that is blocking it.
    -->We also tried sharing a powerpoint (we have a functional office web apps server), which produced the same results.
    -->When we used the Lync 2010 Web App (before we upgraded to 2013), everything seemed to work fine, thus I am concluding that the 2013 Lync Web App (since it has more capabilities) is somehow trying to use more ports or something.
    -->Internally, the Lync Web app works fine.
    So, I assume something in the customer's company's firewall is blocking some access to Lync 2013 Web App.  My question is:  what needs to be enabled both on-premise and at the customer's side to access Lync 2013 Web App screen sharing and if the
    company (for security reasons) doesn't want to open extra ports, is there some work around to force Lync Web App to use port 443 for screen sharing.
    Thanks,
    Adam

    The ports 1024-65535 * are used for application sharing.
    You can configure the port ranges for Lync clients.
    http://technet.microsoft.com/en-us/library/jj204760.aspx
    You can’t use 443 as port 443 is used for HTTPs.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • How to add a custom web apps root page?

    I saw in Jan 2013 System Update the following:
    "Render a custom page when accessing the root URL of a Web App. For example, if you have a “blog” Web App, the items can be made accessible at  /blog/my-blog-post, and you’ll have the ability to customize the /blog page"
    Could someone point me in the correct direction for instructions on how to make use of this feature. 
    Couldn't appear to find a link from the Blog release notes to anything, and also tried trawling through support and forums for a suitable post.
    Closest I found was one about using sub-folders for web app items.
    I've tried adding a page in website admin, with the same URL as the web app, but it simply throws an error as it clashes with Web App url.
    Cheers
    Mike

    Hi Mike.
    Because a folder can have a index.html Web apps in the past you could not access that ability. You had to make a page and you could not SEO call it the same as your web app.
    SO
    Your web app is called Blog.
    You can now make a folder in your root called Blog.
    In that folder you can create a page and give it a url of index.html
    Now when you access the a web app directly - www.yoursite.com/yourwebapp or www.yoursite.com/yourwebapp/index/html you will access that index page.
    You can also put other pages under that folder if you want too.

  • Playbook Browser compatibility with Microsoft Web Apps

    Just a humble suggestion.  Please ensure that your next software update is completely compatible with the new office Web applications.  I have been trying to use my Skydrive account for the last couple of months.  I can see my document, open my document in the playbook browser but it will not allow me to add text when using the MS Word Web App. Thanks.  If this is fixed I'm excited about what I will be able to do.

    Remember, This is a user-to-user community support forum. We are not RIM employees, but volunteers who enjoy assisting other users. RIM personnel rarely comment on queries posted here, and rarely on "future-looking" features or upgrades.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • I want to display the print preview by using JavaScript.

    Can the print preview be displayed by using JavaScript?

    No, web pages doesn't have security rights to access most internal services of Firefox like Print Preview. A web page ''can'' access "Print" thru the operating system.

  • Addition of fields in Adobe forms using JavaScript or FormCalc

    Hi All,
    I have a few amount fields in my Adobe form. I want to calculate their sum and show it in another textfield. Any ideas how this is done using JavaScript or FormCalc.???
    Thanks and Regards,
    Sameer

    Hi Sameer,
    you cant use JavaScript here in Web Dynpro. But if you want to calculate the sum through a button click that can be done through the Action Handler method.
    Suppose you have 2 fields to add whichare field1 and filed2 in the context tree and the sum will be shown in field3 of context tree - all of numeric data type - obviously. So you can do the following in the action handler method.
    int sum = wdContext.currentContextElement().getField1() +
              wdContext.currentContextElement().getField2();
    wdContext.currentContextElement().setFields3(sum);
    Regards,
    Shubhadip

  • Is iPhone email app or GMail web app better for gmail?

    i'm a new iPhone user. i'm have a gmail account which i use almost exclusively through a web browser (i haven't synced it with Mail.app on my MacBook). setting up the iPhone i've used the default email app on the iPhone to check gmail (via POP). it seems to have started at the very first email i ever received 2 years ago and be downloading them in 50-message-at-a-time chunks. independently, i checked it via safari and used the iPhone Gmail web app (hoping that's the right term) which seems to have a fair amount of additional options (labels etc.).
    has anyone got any guidance as to which is a better option?

    I've used both but tend to stick with the Mail app so I can access both my mail accounts together. It's really up to you as to which you like better. You should change your GMail to IMAP instead of POP though... much better email handling and you'll never lose any emails.

  • Muse Web App iOS pages opening up on native browser

    Hello All,
    I created a web app for iOS, when I add the web app to the home screen and launch the web app it loads correctly, my issue is when I tap to go to another page within my web app the page is then opened in Safari. Is there anyway of getting the page to display within the web app? Thanks,

    It's just a web app. I got it semi-working using this work around but some
    parts of my web app break when I reference an old JQuery CDN.
    http://www.bennadel.com/blog/2302-preventing-links-in-standalone-iphone-applications-from- opening-in-mobile-safari.htm
    On Wednesday, December 17, 2014, Brad Lawryk <[email protected]>

Maybe you are looking for