Form Field names

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Form Field names

Marc Vos-3
Hi all,

I hava a question: I know Lasso skips field names from a form that start
with a '-' sign when adding or updating records with standard Lasso
statements, like '-nothing' or '-myfield'. This is a great feature I use a
lot. But now I have to address such a field from Javascript. And Javascript
does not accept the '-' as the beginning of the field name:

    document.MYFORM.-MYFIELD.value = 'kjshd kjsdhk';

is not accepted. Does anyone know of other characters with which I can start
field names and that are being ignored by Lasso's (action_params) when doing
DB access and are accepted by Javascript?

Thanks,

-Marc Vos
* * * * * * * * * * * * * * * * * * * * * * * *
Goodyear Dunlop Tires Germany GmbH
Private:  http://marc.vos.net/
* * * * * * * * * * * * * * * * * * * * * * * *




--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Form Field names

Adam Randall
This should work:

document.MYFORM.elements['-MYFIELD'].value = 'foo';

Adam.

--
Adam Randall <[hidden email]>
Quality Assurance / Support
OmniPilot Software, Inc.
http://www.omnipilot.com/
(954) 874-3100
AIM/iChat: adamomni


On Sep 23, 2005, at 5:53 AM, Marc Vos wrote:

> Hi all,
>
> I hava a question: I know Lasso skips field names from a form that  
> start
> with a '-' sign when adding or updating records with standard Lasso
> statements, like '-nothing' or '-myfield'. This is a great feature  
> I use a
> lot. But now I have to address such a field from Javascript. And  
> Javascript
> does not accept the '-' as the beginning of the field name:
>
>     document.MYFORM.-MYFIELD.value = 'kjshd kjsdhk';
>
> is not accepted. Does anyone know of other characters with which I  
> can start
> field names and that are being ignored by Lasso's (action_params)  
> when doing
> DB access and are accepted by Javascript?
>
> Thanks,
>
> -Marc Vos
> * * * * * * * * * * * * * * * * * * * * * * * *
> Goodyear Dunlop Tires Germany GmbH
> Private:  http://marc.vos.net/
> * * * * * * * * * * * * * * * * * * * * * * * *
>
>
>
>
> --
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription:
> http://www.listsearch.com/lassotalk.lasso?manage
>


--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Form Field names

Olivier Miossec
In reply to this post by Marc Vos-3

Marc Vos ?crit:

> Hi all,
>
> I hava a question: I know Lasso skips field names from a form that start
> with a '-' sign when adding or updating records with standard Lasso
> statements, like '-nothing' or '-myfield'. This is a great feature I use a
> lot. But now I have to address such a field from Javascript. And Javascript
> does not accept the '-' as the beginning of the field name:
>
>     document.MYFORM.-MYFIELD.value = 'kjshd kjsdhk';
>
> is not accepted. Does anyone know of other characters with which I can start
> field names and that are being ignored by Lasso's (action_params) when doing
> DB access and are accepted by Javascript?
>
> Thanks,


You can use the Arrays Elements froom the form object in Javascript

document.form01.elements[0].value;




---
Olivier Miossec
AIM/ichat omiossec
--
http://www.lasso-developpeur.net
--

Need a Lasso consultant ?
(Lasso, Java, Databases Consultant ...)
http://www.lasso-developpeur.net/oliviermiossec/

--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Form Field names

Marc Vos-3
In reply to this post by Marc Vos-3
Thanks for the tip!

After a bit of brain gymnastics I could get Lasso to format my Javascript.
Here's the source script:

    if (orname.length > 0) {

window.opener.document.[action_param('sel1')].elements["['" + $zzVAR1 +
"']"].value = orname;
    }

And after the page is served this what the browser gets:

    if (orname.length > 0) {
        window.opener.document.CITY.elements['-XXNAME'].value = orname;
    }

Works fantastic!

Thanks!

Marc Vos
* * * * * * * * * * * * * * * * * * * * * * * *
Goodyear Dunlop Tires Germany GmbH
Private:  http://marc.vos.net/
* * * * * * * * * * * * * * * * * * * * * * * *



On 23-09-2005 12:42, "Adam Randall" <[hidden email]> wrote:

> This should work:
>
> document.MYFORM.elements['-MYFIELD'].value = 'foo';
>
> Adam.
>
> --
>
> On Sep 23, 2005, at 5:53 AM, Marc Vos wrote:
>
>> Hi all,
>>
>> I hava a question: I know Lasso skips field names from a form that
>> start
>> with a '-' sign when adding or updating records with standard Lasso
>> statements, like '-nothing' or '-myfield'. This is a great feature
>> I use a
>> lot. But now I have to address such a field from Javascript. And
>> Javascript
>> does not accept the '-' as the beginning of the field name:
>>
>>     document.MYFORM.-MYFIELD.value = 'kjshd kjsdhk';
>>
>> is not accepted. Does anyone know of other characters with which I
>> can start
>> field names and that are being ignored by Lasso's (action_params)
>> when doing
>> DB access and are accepted by Javascript?
>>
>> Thanks,
>>
>> -Marc Vos



--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Form Field names

Mark Kawakami
In reply to this post by Marc Vos-3
You can also specify an id attribute in the tag and use  
document.getElementById('theIdOfTheElement') in your javascript. It  
should generally be faster, though by a tiny amount.

<input type="text" name="-MYFIELD" id="MYFIELD" value="" />
<script type="text/javascript">
    document.getElementById("MYFIELD").value='blah blah';
</script>


... you can probably use the hyphen in the id attribute, but I can't  
recall for sure.

-Mark

On Sep 23, 2005, at 2:53 AM, Marc Vos wrote:

> Hi all,
>
> I hava a question: I know Lasso skips field names from a form that  
> start
> with a '-' sign when adding or updating records with standard Lasso
> statements, like '-nothing' or '-myfield'. This is a great feature  
> I use a
> lot. But now I have to address such a field from Javascript. And  
> Javascript
> does not accept the '-' as the beginning of the field name:
>
>     document.MYFORM.-MYFIELD.value = 'kjshd kjsdhk';
>
> is not accepted. Does anyone know of other characters with which I  
> can start
> field names and that are being ignored by Lasso's (action_params)  
> when doing
> DB access and are accepted by Javascript?
>
> Thanks,
>
> -Marc Vos
> * * * * * * * * * * * * * * * * * * * * * * * *
> Goodyear Dunlop Tires Germany GmbH
> Private:  http://marc.vos.net/
> * * * * * * * * * * * * * * * * * * * * * * * *
>
>
>
>
> --
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription:
> http://www.listsearch.com/lassotalk.lasso?manage
>


The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material.  Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.  If you received this in error, please contact the sender and delete the material from any computer.


--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage