smth wrong with input value

W

Weedget

Hello!

i've code from above...
when i blur my input text field i get undefined result from
'this.value' in function 'process'
what i'm doing wrong?
anybody can help me? :>

function zmien(id, id_src)
{
var dozmiany;
var html;
dozmiany=document.getElementById(id_src).innerHTML;
html = '<input id=\'input'+id+'\' type=\'text\' onblur=\"zmien(\''+id
+'\',\''+id_src+'\',0); process(\''+id+'\',\''+id_src+'\',
\''+this.value+'\');\"/>';
document.getElementById(id).innerHTML=html;
document.getElementById('input' +id).value=dozmiany;
}

Regards
Weedget
 
R

RobG

Hello!

i've code from above...
when i blur my input text field i get undefined result from
'this.value' in function 'process'
what i'm doing wrong?
anybody can help me? :>

function zmien(id, id_src)
{
var dozmiany;
var html;
dozmiany=document.getElementById(id_src).innerHTML;
html = '<input id=\'input'+id+'\' type=\'text\' onblur=\"zmien(\''+id
+'\',\''+id_src+'\',0); process(\''+id+'\',\''+id_src+'\',
\''+this.value+'\');\"/>';

Do not quote the double quotes:

dozmiany=document.getElementById(id_src).innerHTML;
html = '<input id="input'+id+'" type="text" onblur="zmien(\''+id
+ '\',\''+id_src+'\',0); process(\''+id+'\',\''+id_src
+ '\', \''+this.value+'\');">';

untested of course. If that doesn't work, use DOM methods.
 
W

Weedget

Do not quote the double quotes:
dozmiany=document.getElementById(id_src).innerHTML;
html = '<input id="input'+id+'" type="text" onblur="zmien(\''+id
+ '\',\''+id_src+'\',0); process(\''+id+'\',\''+id_src
+ '\', \''+this.value+'\');">';

untested of course. If that doesn't work, use DOM methods.


thx...
on morning when i looked at this once again i find my mistake :)

should be

html = '<input id="input'+id+'" type="text" onblur="zmien(\''+id
+ '\',\''+id_src+'\',0); process(\''+id+'\',\''+id_src
+ '\', this.value);">';

and now it works :)

Weedget
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,159
Messages
2,570,884
Members
47,419
Latest member
ArturoBres

Latest Threads

Top