Hi GreyHead
I need to get the form name to use in javaScript validation
below i have the model of my validation
All what I need is to get the form name and put the value in my validation
I tried the code:
and if i try to see like
I can see the name of form
but when i write
is return the the Undefined
where am I doing wrong?
Please Help, i Buyed your book but i didnt found nothing about this issue
By the way congratuations for your book, i Learning a lot specialy the barcode into email. Now i can create PromoCodes to my customers
I need to get the form name to use in javaScript validation
below i have the model of my validation
alert("Message of Alert here")
document.FormName.ElementName.value="";
document.FormName.ElementName.focus();
return false;
All what I need is to get the form name and put the value in my validation
I tried the code:
theForms = document.getElementsByTagName("form");
for(k=0;k<theForms.length;k++)
and if i try to see like
alert(theForms[k].name);
I can see the name of form
but when i write
alert("Message of Alert here")
document.theForms[k].name.ElementName.value="";
document.theForms[k].name.ElementName.focus();
return false;
is return the the Undefined
where am I doing wrong?
Please Help, i Buyed your book but i didnt found nothing about this issue
By the way congratuations for your book, i Learning a lot specialy the barcode into email. Now i can create PromoCodes to my customers
Hi clovismmbr,
You can set the Form Name as a variable in the Form Javascript box
Bob
PS Personally I'd use the MooTools methods and address the elements using their ids.
You can set the Form Name as a variable in the Form Javascript box
var formname = '<?php echo $MyForm->formrow->name; ?>';
Bob
PS Personally I'd use the MooTools methods and address the elements using their ids.
This works but when I use it I get an error 'undefined'.
I have a specific validation in javascript that i will use in all forms
i think i have to study more javascript.
for a while i am typing the name of the form in each javascript box.
I have a specific validation in javascript that i will use in all forms
i think i have to study more javascript.
for a while i am typing the name of the form in each javascript box.
Hi clovismmbr ,
Sorry, I missed some quotes :-(
Please try:
Bob
Sorry, I missed some quotes :-(
Please try:
var formname = '<?php echo $MyForm->formrow->name; ?>';
Bob
Hello Bob, thank you, this solved my issues
This topic is locked and no more replies can be posted.