I'm sure this has an easy answer, but I don't know it.

so I have a widget that will let you get alerts texted to a phone. I am trying to store the info, but I can't get the user's input into my javascript function shown below:

onClick="collect('info', 'nname=' + document.getObjectByID('Nname').value + ';num=12345;

How can I get the content as a string of a text field and use that in my function? Like I said, this is probably a relatively easy question for most, but I cannot figure it out :/

Recommended Answers

I think your method signature is something like following:

function collect(a,b,c)

the onclick should be like

onclick="collect('info', document.getObjectByID('Nname').value, 12345)"

You do not have to pass the parameters as you passing GET variables in http requests

Jump to Post

Yep..!! my mistake... it should be getElementById

Jump to Post

All 5 Replies

I think your method signature is something like following:

function collect(a,b,c)

the onclick should be like

onclick="collect('info', document.getObjectByID('Nname').value, 12345)"

You do not have to pass the parameters as you passing GET variables in http requests

Member Avatar

Shouldn't it be getElementById, not getObjectByID?

Yep..!! my mistake... it should be getElementById

omg thank you so much! I spelled 'element' wrong. I am stupid. Anyway, thanks again!

Nice..!! :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.