Great Ideas. Always Flowing.

We are not happy until you are happy. Client satisfaction guaranteed. Whatever your needs and requirements, we have the skills and resources for the job!

Quick login...


Or... now make it easy with Facebook Integration
Connect via Facebook



Top Sellers

Frustrated over the lack of customization for your user's registration fields? Dynamically setup your DNN Portal with custom registration fields, layout, questions, and other core integration options......

Ultra Video Gallery is a brother product of Ultra Media Gallery, UVG allows you to upload videos in various format and automatically encode them to flv or H264 format, you also can add videos from internet or record live videos from your webcam.

Build high performance, completely customizable data-entry forms and views driven by your DNN and external databases. New built-in tools make it a snap to quickly create data entry forms, data views, and even database tables. Plus, add your own HTML, CSS, Javascript, SQL commands, stored procedures,

The most advanced DotNetNuke shopping cart on the planet. Easy to use e-Commerce, Secure Shopping Cart Software and SEO friendly. B2C / B2B Ecommerce Sites.

One stop solution for events calendar and events registration! FREE DOWNLOAD is available now!

Hide submission button based on value of databinded field
Last Post 08-04-2011 11:10 AM by Doug. 7 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Not Resolved
DougUser is Offline
skipping stones
skipping stones
Posts:7
Avatar

--
08-03-2011 06:56 AM
    Hello!

    I'm trying to hide the submission button at page load if my databinded, hidden field named 'StateNotAvail' = True. This is on step 2 of an online quoting process, so some info is collected on step 1 and then passed through SQL for some quoting, etc, and then I'm using databind to populate some hidden fields to continue the quote process (on a separate page). One of the pieces of info collected in step 1 is the State that the customer resides in. There are a few states that we do not provide our product to, so on the 2nd step I have a message that is displayed based on a hidden field that is databinded after a lookup is done against my database. On top of the question event that shows the html field with the 'state not available' message, I have another question event that hides all other fields if state is not available.

    What I need to be able to do is also hide the submission button in this case, however since it is not an option during a question event it gets a little tricky. I have the following set up in the Initial Javascript for the module, but apparently this happens before the databind which therefore does not pick up the value of the hidden field.

    if ( $(StateNotAvail).ToUpperCase() == 'TRUE')
    {
    hidehtml('SaveForm')
    }
    else
    {
    showhtml('SaveForm')
    }


    How else can I accomplish this??


    Thanks,
    Doug
    Don GeeUser is Offline
    river guide
    river guide
    Posts:273
    Avatar

    --
    08-03-2011 08:21 AM
    Hi Doug,
    Can you put your sample on BetaSprings where we can look at the code? I think you probably have something missing in your javascript. If you run your code on firefox you can use firebug to inspect the elements and see better what is going on. The login for www.betasprings.com is host,dnnhost. If you make a sample of your code there something like Doug'S Javascript then let me know.
    Thanks
    DougUser is Offline
    skipping stones
    skipping stones
    Posts:7
    Avatar

    --
    08-03-2011 09:22 AM

    That same code works as a client side event, would it need to be any different in the Initial Javascript section in the module settings? The design doesn't quite work right when 'hiding initially' and then displaying based on a client side event, though.

    If I used an HTML field with my button image in there, is there a way to make the image a link which submits the form (while still passing all the session variables)?? If this is possible, I could then hide this field along with all the other ones in my question event that looks at the StateNotAvail field.

    Anyone know if this is possible?

     

    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    08-03-2011 10:12 AM
    Hello Doug,

    Perhaps you can find the ID of the DIV tag around the submit button then use:

    IF($(StateNotAvail).ToUpperCase() == 'TRUE')
    {
    document.getElementById('IDOfSubmitButton').style.display = 'none' // hiding submit
    }
    ELSE
    {
    document.getElementById('IDOfSubmitButton').style.display = ''; // showing submit
    }

    Let me know if this helps.

    Thanks,

    Ryan
    DougUser is Offline
    skipping stones
    skipping stones
    Posts:7
    Avatar

    --
    08-03-2011 11:40 AM
    Ryan,
    Clever approach, but unfortunately the button remained regardless of the value of the hidden field

    I tried plugging in the DIV ID as well as the ID of the image field to your script, both no dice.

    I did see this is the source:

    onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("dnn$ctr2431$DynamicForms$imgSave", "", true, "DynamicForms_2431", "", false, false))"

    Any way to incorporate that into an HTML field with an image link?
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    08-04-2011 04:49 AM
    Hello Doug,

    I will setup a working example for you on Betasprings.com and provide the link inside this forum post after completed. Please hang in there until I have this created.

    Thanks,

    Ryan
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    08-04-2011 09:48 AM
    Hello Doug,

    Please take a look at this example that I made for you:

    http://www.betasprings.com/DynamicF...fault.aspx

    To login and view the contents of how this works, please use Host / dnnhost to login to www.betasprings.com

    Let me know if you have any questions.

    Thanks,

    Ryan
    DougUser is Offline
    skipping stones
    skipping stones
    Posts:7
    Avatar

    --
    08-04-2011 11:10 AM
    Ryan,

    Thanks for the example. I understand how to get it to do that, and have it working as a client side event. The reason this won't quite work though in my case is because if I have the button hidden initially and appear once the final question is selected, the user may change their answer to a previous question, which requires another postback and therefore re-hides the submit button, however when my final question has only one option, it remains selected but with no submit button. Does this make sense?
    Basically going off of your example, what I need is the value of the Yes/No question read in from a databind, and the visibility of the submit button then determined by that when the page loads. If you could get that working that would be fantastic!!
    You are not authorized to post a reply.


     
     

    Join our mailing list...

    Get current news and events the easy way
    Subscribe Me

    Recent Blogs...

     
    Copyright 2005 - 2011 by Data Springs, Inc.
     
  • film izle
  • 720 izle
  • film
  • sinema izle
  • film makinesi
  • T�rk�e dublaj film
  • film izle
  • film izle
  • baglan film izle
  • sinema izle
  • 1080 film izle
  • film mercegi