boofulls
asked on
onchange syntax error
in asp/vbscript i try to do this javascript
response.write ourSymbol & "<input type=text name='IT" & rs.fields.item("ProductID" ) & "' size=6
onChange='alert('This is a calculated field')'>"
which gives
€<input type=text name='IT27' size=6 onChange='alert('This is a calculated field')'>
but it says theres a syntax error??
response.write ourSymbol & "<input type=text name='IT" & rs.fields.item("ProductID"
onChange='alert('This is a calculated field')'>"
which gives
€<input type=text name='IT27' size=6 onChange='alert('This is a calculated field')'>
but it says theres a syntax error??
onChange='alert(\'This is a calculated field\')'>
Try this:
response.write "<<script>var msg1 = 'This is a calculated field'</script>"
response.write ourSymbol & "<input type=text name='IT" & rs.fields.item("ProductID" ) & "' size=6 onChange='alert(msg1)'>"
Good luck,
zvonko
response.write "<<script>var msg1 = 'This is a calculated field'</script>"
response.write ourSymbol & "<input type=text name='IT" & rs.fields.item("ProductID"
Good luck,
zvonko
or, if you want double-quotes in VBScript, then you double them:
response.write ourSymbol & "<input type='text' name='IT" & rs.fields.item("ProductID" ) & "' size='6'
onChange='alert(""This is a calculated field"")'>"
response.write ourSymbol & "<input type='text' name='IT" & rs.fields.item("ProductID"
onChange='alert(""This is a calculated field"")'>"
Sorry, a typo. Here corrected:
Try this:
response.write "<script>var msg1 = 'This is a calculated field'</script>"
response.write ourSymbol & "<input type=text name='IT" & rs.fields.item("ProductID" ) & "' size=6 onChange='alert(msg1)'>"
Of course is a better idea to place all strings into variables in <head> section.
Cheers,
zvonko
Try this:
response.write "<script>var msg1 = 'This is a calculated field'</script>"
response.write ourSymbol & "<input type=text name='IT" & rs.fields.item("ProductID"
Of course is a better idea to place all strings into variables in <head> section.
Cheers,
zvonko
ASKER
knighteknight
i try this
or, if you want double-quotes in VBScript, then you double them:
response.write ourSymbol & "<input type='text' name='IT" & rs.fields.item("ProductID" ) & "' size='6'
onChange='alert(""This is a calculated field"")'>"
it works but when i edit the field it stays edited, i want it to not editable
thanks
i try this
or, if you want double-quotes in VBScript, then you double them:
response.write ourSymbol & "<input type='text' name='IT" & rs.fields.item("ProductID"
onChange='alert(""This is a calculated field"")'>"
it works but when i edit the field it stays edited, i want it to not editable
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
... instead of the onChange (which is not needed if that is all you want to do)
ASKER
zvonko
this works too
response.write "<script>var msg1 = 'This is a calculated field'</script>"
response.write ourSymbol & "<input type=text name='IT" & rs.fields.item("ProductID" ) & "' size=6 onChange='alert(msg1)'>"
but again id like the field to not be editable
thanks
this works too
response.write "<script>var msg1 = 'This is a calculated field'</script>"
response.write ourSymbol & "<input type=text name='IT" & rs.fields.item("ProductID"
but again id like the field to not be editable
thanks
Hey, this is experts exchange :)