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!

getElementById
Last Post 10-31-2011 08:22 AM by Don Gee. 6 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Damian MaurinoUser is Offline
wading in the water
wading in the water
Posts:20
Avatar

--
10-18-2011 05:46 AM
    Hello everyone!

    So, this was bugging me for a while. I just want to change the style of a button to visible = true / false, because if I hide it/show it using a question event I loose the default value and can't set it using another question event unlike a textbox.

    I'm aware that a token, for example $(MyButton) is just an abbreviation of document.getElementById('dnn_ctr520_DynamicForms_btn_GUIDbe00093b-9da9-48c5-bda4-2518c7f388c9').value

    So, I just want to change that .value into .style like this:

    function IdFromToken(token){

    var bruja = token.replace("document.getElementById('","");
    bruja = bruja.replace("').value","");

    return bruja;
    }

    document.getElementById(IdFromToken($(MyButton))).value = 'HELLO!';


    That should change my button text to "HELLO!" (without the quotes) but for some reason it doesn't.

    The thing is, is there any better way to do this? Meaning.. to get the element from an ID? I already tried getElementById(MyButton) as I found in the forum but it didn't work =(.

    I just happen to do this function which is a really horrible solution but I don't have a lot of time to play around with tutorials and stuff and I wanted to "code my way to victory" =P


    By the way, this is the line I'm getting in the source code:

    document.getElementById(IdFromToken(document.getElementById('dnn_ctr520_DynamicForms_btn_GUIDbe00093b-9da9-48c5-bda4-2518c7f388c9').value)).value = 'NIACA NIACA';
    the whole idea was to remove the whole getElement part and the .value part so the function returns just the id, but it didn't work =(

    Thanks in advance!
    Damian MaurinoUser is Offline
    wading in the water
    wading in the water
    Posts:20
    Avatar

    --
    10-18-2011 06:26 AM
    by the way I tried this

    function IdFromToken(token){

    var bruja = token;
    bruja = bruja.replace(/'/g, '');
    bruja = bruja.replace(/[\(\)\.\-\s,]/g, "");
    bruja = bruja.replace("value","");
    bruja = bruja.replace("document.getElementById","");

    return bruja;
    }


    and it didn't work either =(
    Don GeeUser is Offline
    river guide
    river guide
    Posts:273
    Avatar

    --
    10-18-2011 07:44 AM
    Hi Damien,
    For this sample we may need to have you place it on www.betasprings.com in the dynamic forms area where the login is host, dnnhost. Then we can look at the code better and go over the matter to see what might be wrong. I have some parts of this message that is cropping so I am sorry to say that part of it is not readable. Can you tell me if you are working with changing the text in the submit button for the form or customized text on a HTML button as a dynamic question?
    Thanks
    Don GeeUser is Offline
    river guide
    river guide
    Posts:273
    Avatar

    --
    10-18-2011 08:07 AM
    Hi Damien,
    On a part of the message that I can read you say you are doing:

    document.getElementById(IdFromToken($(MyButton))).value = 'HELLO!'

    Please take a look at this demo in dynamic forms. I think what you are doing is going to put "Hello" into the value of the field and not change the text value or html label of the field. See demo 20: http://www.datasprings.com/products...lculations

    If you are dealing with the submit button in the dynamic form then you can change the text on that with standard features that are a part of dynamic forms. You can change submit button to read "Bruja" by going to the "submit button/link" section and doing it there. If you have any questions on how to do this let me know but this will not require client side scripting to accomplish.
    Thanks

    Damian MaurinoUser is Offline
    wading in the water
    wading in the water
    Posts:20
    Avatar

    --
    10-19-2011 04:07 AM
    Hello Gee!

    First of all, here's my FIRST post in TinyPaste so you can clearly see it:
    http://tinypaste.com/78209b

    Edit: Here's THIS post in tinypaste. I hate this crop thing!! =P
    http://tinypaste.com/9fb33

    Second, just for you to know, I've done both that demo and demo 32 I beleve and they helped a lot (they are awesome). However, I'm in the need of something different here which I'm not able to find in the demos I've looked so far =(.

    Third, yes: I'm working to change the text of an HTML Button, and also it's visibility. The text thingy is just a test to see if it works. I can't make it change with a question event though. I think that changing html buttons' caption with question events is not supported.

    Fourth, I'm aware of what you say. I'm putting 'hello' in the value of the field and not changing the label. I know that. The .value of the HTML button is it's caption. You can try it yourself. Set up an html button with name "TestButton". And then run a javascript with any field like this:

    $(MyButton) = 'Hello';

    After that, you should see that the button caption (meaning the text inside the button) was changed from "Click Here" to "Hello". Meaning that the whole

    document.getElementById('dnn289792_yougetthepoint').value = 'Hello';

    Should work. Because the token $(MyButton) is replaced by the whole thing written above. But it doesn't =(.

    Anyway, that's not the point anyway. What I want to do is HIDE/SHOW that button using a javascript (NOT a question event, due to the default caption being lost and being unable to set it using a question event because it's a HTML button and not a Textbox/Combobox/etc). That .value thing is just a test to see if it works. I mean: if the .value thing works, the .style.visibility should work too.

    If there's any easier way to do this, please let me know. I've done it getting the ID of the button using the source code, but I really want to find a workaround for that, cause it's very untidy and not portable =).

    Thanks for your help Gee! Seriously!
    Don GeeUser is Offline
    river guide
    river guide
    Posts:273
    Avatar

    --
    10-31-2011 08:17 AM
    Hi Damian,
    Would you be willing to make a sample of your problem on BetaSprings where
    we can look at it together? This is a Dynamic Forms issue so there is a spot
    there to put it. The login there is host, dnnhost. It doesn't look like there is a
    lot of code that you are working with to make the HTML button and your attempt
    to Hide/show it. There are still some words being cropped so I am reading
    only part of the message but please do be ready if the answer is not
    "an easier way" to do it as you put it above. If you put this on BetaSprings
    please provide me the link so I can go look at it and even change things and get
    back with you.
    Thanks
    Don GeeUser is Offline
    river guide
    river guide
    Posts:273
    Avatar

    --
    10-31-2011 08:22 AM
    Damian,
    Also, can you look at this demo on DataSprings and see if any part of it helps
    you. It is demo 20 in the support area:
    http://www.datasprings.com/products...lculations
    There is parts here dealing with javascript and HTML elements
    Don
    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