Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Creating same text value for two text fields

Creating same text value for two text fields

Scheduled Pinned Locked Moved Web Development
javascripthelpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    BravoTwoZero
    wrote on last edited by
    #1

    Hi, In my form, I have two text fields called txt1 and txt2. I am using javascript pop up calender and creating date value for txt1 and calling a function onchange="popVal()" in txt1. function popVal(){ window.document.form1.txt2.value = window.document.form1.txt1.value } this does not insert the txt1 date value into txt2. I tried onblur, onfocus as well. can any body help?! I will be most greatful. Thank you. Bravo Two Zero A pen is mighter then a sword.

    N 1 Reply Last reply
    0
    • B BravoTwoZero

      Hi, In my form, I have two text fields called txt1 and txt2. I am using javascript pop up calender and creating date value for txt1 and calling a function onchange="popVal()" in txt1. function popVal(){ window.document.form1.txt2.value = window.document.form1.txt1.value } this does not insert the txt1 date value into txt2. I tried onblur, onfocus as well. can any body help?! I will be most greatful. Thank you. Bravo Two Zero A pen is mighter then a sword.

      N Offline
      N Offline
      Nick Parker
      wrote on last edited by
      #2

      BravoTwoZero wrote: and calling a function onchange="popVal()" in txt1. function popVal(){ window.document.form1.txt2.value = window.document.form1.txt1.value } This won't work as you have noted when you are setting the values programmtically. No "event" has taken place for that function to be called. I would assume that you are either loading the pop up calendar either with the onLoad event or by clicking a button. I would suggest that you add an additional function call to check the value of txt1 after the function has returned, then populate txt2. Hope this helps. Nick Parker
      May your glass be ever full. May the roof over your head be always strong. And may you be in heaven half an hour before the devil knows you’re dead. - Irish Blessing


      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups