Re: [PHP] Can javascript or php help with this

[email protected] (dealTek)
Newsgroups php.general
Message-ID <[email protected]>
On May 26, 2013, at 5:48 AM, Jim Giner <[email protected]> wrote:

> On 5/25/2013 9:11 PM, dealTek wrote:
>> 
>> On May 25, 2013, at 4:30 PM, Jim Giner <[email protected]> wrote:
>>>> 
>>>> 
>>> So - create another field on your form.  Add an onclick event to your submit button.  Have it run a js function that takes the two fields and places them into the new field.
>>> 
>>> function combineFields()
>>> {
>>>  var mm = document.getElementById("monthfld").value;
>>>  var yy = document.getElementById('yearfld").value;
>>>  document.getElementByID("mmyy").value = ""+mm+yy;
>>>  return true;
>>> }
>>> 
>>> Might have to play with this syntax to avoid the values being arithmetically added instead of concatenated, but this is one way.
>>> 
>>> And of course - you could try posting on a js site instead of a php one.
>> 

>> 
> HTH.
> BTW - I see a small typo in my concat statement - 'Id', not 'ID'.
> 
> -- 

AHA - at first it was not working but now it works like a charm - THANKS Jim - this really helps a lot!!!



--
Thanks,
Dave - DealTek
[email protected]
[db-3]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.