Posted By Ryan Bakerink on 10/27/2010 12:24 PM
Hello Chuck,
Unfortunately I can't spend too much time implementing this JavaScript for you, so I have made the minimal modifications needed to get the values put into the textbox via JavaScript.
If you look in the source code of the page you can find the ID of the text boxes on the form and use that like this in your function:
document.getElementById('dnn_ctr2308_DynamicForms_TBR_GUID263498be-c77b-431a-aa5d-535125c8db3cValue1').value= 5;
Here's your page:
http://www.betasprings.com/Dynamic-...fault.aspx" target="_blank" rel="nofollow">http://www.betasprings.com/Dynamic-...fault.aspx
If you have any questions please let me know.
Thanks Chuck,
Ryan
Ryan, I appreciate the reply. But its still not what I am looking for. I do understand you are busy but I dont think its would be hard to give me a one line syntax to identify a field, but I could be wrong in my assumption. Yes its easy just to identify the actual ID of the shortname by using the source code. But if I want to create the form in another module, I dont want to keep having to revert to trying to find the ID by looking at the source constantly to reach my goals.
I know in the initial javascript I can identify my field ID by coding:
var value1 = $(value1_FieldID)
document.getElementById(value1).value = 123
On load of the form it will let me set my shortname Value1 field to 123
BUT, let me specific again, if I have a function in the in the CUSTOM JAVASCRIPT as a function and I call a function from my CLIENT SIDE event WITHOUT passing a parameter and I want to set a value to shortname, How do I identify it?
If we use our example above of value1, in the function called testFunction()
BTW, I am using the same betasprings page, to reflect the coding change for my example.
http://www.betasprings.com/Dynamic-...fault.aspx" target="_blank" rel="nofollow">http://www.betasprings.com/Dynamic-...fault.aspx
function testFunction(){
var value1 = $(value1_FieldID)
document.getElementById(value1).value = 12345;
}
Why is that in the module, it works in the INITIAL JAVASCRIPT section, but does not work in the JAVASCRIPT FILE?
I appreciate a clarification,
Chuck