Jump to content

[SOLVED] new in javascript......need help..


new_php85

Recommended Posts

hai.. i new in js...

i need some helps

 

from other resoures to read value in field using javascript can do like this

example:

me.date_me.value

 

me is form name

date_me is field name

 

but if i do like that it will read the whole field.how come if i want only read the 7 character from the field?

plzz help me....

Link to comment
https://forums.phpfreaks.com/topic/132236-solved-new-in-javascriptneed-help/
Share on other sites

here is a real simple way to do this:

 

<script type="text/javascript">
function getVal() 
{
var val = me.date_me.value;
document.getElementById("field").value = val;
}
</script>

<form name="me">
<input type="text" name="date_me" 
<input type="hidden" id="field" maxlength="7">
</form>

  • 2 weeks later...

here is a real simple way to do this:

 

<script type="text/javascript">
function getVal() 
{
var val = me.date_me.value;
document.getElementById("field").value = val;
}
</script>

<form name="me">
<input type="text" name="date_me" 
<input type="hidden" id="field" maxlength="7">
</form>

 

 

thank tou for your information.i got it..

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.