Re: newbee's simple question
If you view the page in the browser, (look at it's source), you'll see that the textbox most likely has a different ID. You need to plug in that ID into your javascript code.
Re: newbee's simple question
I think in JS, you reference the contents of textbox (and other form items) with hdnChecklist.Value, not hdnChecklist.Text (which is the way VB does it).
Re: newbee's simple question
Hi Sandpaper and scottst!
You both were right. Once I fixed the id and text to value my alert worked displaying the: "Test".
<script language="javascript"
function onSubmit(){
alert(document.Form1.hdnChecklist.value);
document.Form1.submit();
}
</script>
But when I put a condition in - the code doesn't work:
<script language="javascript"
function onSubmit(){
if document.Form1.hdnChecklist.value == "Test" {
alert(document.Form1.hdnChecklist.value);
document.Form1.submit();
}
}
</script>
Why???
Thanks a lot!
Gina
Re: newbee's simple question
You also need brackets around the condition!
if (document.Form1.hdnChecklist.value == "Test") {
Re: newbee's simple question
Re: newbee's simple question
Sorry... I see now that I missed the brackets! I can't grasp when you need to insert paranthesis ( and {} in JavaScript. It seems that I've always miss them and there is no way to debug to see why the code doesn't work. Is there a simple rule for dummies :( ??
Gina