Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-22-2013, 03:18 AM   PM User | #1
bago
New to the CF scene

 
Join Date: Jan 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
bago is an unknown quantity at this point
Help needed with input script.

Hi,

I am not a Javascript person at all, but I found a script that does everything I need which is to take a URL get variable and put it into a form input field. The only problem is that the input field name that I need to get the variable posted too has periods in the input name (entry.24.single), and I cant simply change the name on the input field as I am using this in a custom google form input page.

So here is the line of code that is creating the problem. The InputName needs to be changed to entry.24.single, and I haven't been able to figure out how to do that.

document.forms.MyForm.InputName.value = GETDATA["foo"];

Your assistance is greatly appreciated!
bago is offline   Reply With Quote
Old 01-22-2013, 05:25 AM   PM User | #2
Logic Ali
Regular Coder

 
Logic Ali's Avatar
 
Join Date: Sep 2010
Location: London
Posts: 959
Thanks: 0
Thanked 198 Times in 193 Posts
Logic Ali will become famous soon enoughLogic Ali will become famous soon enough
Leaving aside the fact that the form should not have a name but rather an ID:

document.forms.MyForm[ "entry.24.single" ].value = GETDATA["foo"];

When you change to an ID:

document.getElementById( "MyFormID" )[ "entry.24.single" ].value = GETDATA["foo"];

Last edited by Logic Ali; 01-22-2013 at 05:28 AM..
Logic Ali is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:17 AM.


Advertisement
Log in to turn off these ads.