Add new properties to <Input> tag 
Author Message
 Add new properties to <Input> tag

How to add new properites to <Input> tag?

I am trying to make another property called .text?, because some of old code
uses third party control, ahd needs (dot).text to store/retrive the value
insted of (dot).value property.

Thanks in advance.
Uma



Sat, 20 Sep 2003 02:00:55 GMT  
 Add new properties to <Input> tag
Simply add a text property to the input and update its value when the
input's value changes:

  <input text="text" onchange="VBScript:me.text=me.value" ...>

=-=-=
Steve
-=-=-


Quote:
> How to add new properites to <Input> tag?

> I am trying to make another property called .text?, because some of old
code
> uses third party control, ahd needs (dot).text to store/retrive the value
> insted of (dot).value property.

> Thanks in advance.
> Uma



Sat, 20 Sep 2003 04:19:02 GMT  
 Add new properties to <Input> tag
Hi Steve,

Giving error:

When i change something in input box and click on Ok button, while trying to
retrive the value as (dot).text (I am getting error again: [Object doesn't
support this property or method: 'txtName.text']

* If I could assing the value like ==>  txtName.text = "bla bla bal"
* And retrive the value as ==> msgbox txtName.text

need help to find the soultion.

Regards,
Uma

Sample asp pasted..

*********** test.asp ************
<Script Language="VBScript">

         Sub btnOK_click()
                msgbox txtName.text
         End Sub

</Script>

<HTML>
<Head>
</Head>
<Body>
               <input name="txtName" type="text"
onchange="vbscript:txtName.text=txtName.value">
               <input type="button" name="btnOK">
</Body
</HTML>
******** End of test.asp ****************


Quote:
> Simply add a text property to the input and update its value when the
> input's value changes:

>   <input text="text" onchange="vbscript:me.text=me.value" ...>

> =-=-=
> Steve
> -=-=-



> > How to add new properites to <Input> tag?

> > I am trying to make another property called .text?, because some of old
> code
> > uses third party control, ahd needs (dot).text to store/retrive the
value
> > insted of (dot).value property.

> > Thanks in advance.
> > Uma



Sun, 21 Sep 2003 20:20:36 GMT  
 Add new properties to <Input> tag
Got it myself.

Just use        .setAttribute method.

thanks guys.
Uma


Quote:
> How to add new properites to <Input> tag?

> I am trying to make another property called .text?, because some of old
code
> uses third party control, ahd needs (dot).text to store/retrive the value
> insted of (dot).value property.

> Thanks in advance.
> Uma



Sun, 21 Sep 2003 22:03:29 GMT  
 Add new properties to <Input> tag
Does setAttribute work in IE4? I'm not sure it does.

VBScript won't add a property to an object; you have to add a text property
to the input tag in your html so the script can modify it.
                                    vvvv
  <input name="txtName" type="text" text onchange="vbscript:me.text=me.value">
                                    ^^^^
The simple solution is to use JavaScript, since it will gleefully add
properties to objects if they don't already exist:

  <input name="txtName" type="text" onchange="this.text=this.value">

The benefit of using JavaScript for client-side scripting is that a lot more
browsers support it than just IE/Win.

If your target audience uses IE5+/Win exclusively, the VBScript/setAttribute
solution should be fine.

=-=-=
Steve
-=-=-


Quote:
> Got it myself.

> Just use        .setAttribute method.

> thanks guys.
> Uma



> > How to add new properites to <Input> tag?

> > I am trying to make another property called .text?, because some of old
> code
> > uses third party control, ahd needs (dot).text to store/retrive the
value
> > insted of (dot).value property.

> > Thanks in advance.
> > Uma



Sun, 21 Sep 2003 23:37:55 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. <<<<<<<<ComboBox>>>>>>>>>>>>

2. --------<<<<<<MONEY>>>>>>--------- id 9543

3. HELP >>>>>>WIN API <<<<<<<<<<

4. text property of a <SCRIPT> tag

5. help me out please!!!!<<<<<<<<<<<<<<<<<<<<<<<thanks>>>>>>>>>>>>>>>>>>>>>>>>

6. Adding code to a <FORM> tag

7. <<VB3 HELP>>HOW DO YOU ADD WAV FILES TO VB3 FORMS

8. <><><>HELP<><><> PCMCIA Motorola Montana 33.6

9. <<<<HELP- OLE container Control>>>>>>>>>

10. VB5<->RDO2<->ODBC<->ORACLE Procedure Problem

11. <<<Cneck Box>>>

12. <<<Gif Files>>>

 

 
Powered by phpBB® Forum Software