Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8778415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:31:59+00:00 2026-06-13T19:31:59+00:00

How to echo value from input box ( form name=form1 ) to input box

  • 0

How to echo value from input box (form name="form1") to input box (form name="form2")

I figured out how to echo the input within the first form.. and also withind the div.. but I can’t figure it out how to pass the inpus from the input boxes in the first form (form1).. into the input boxes in the second form (form2).

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript">
function FillBilling(f) {
    f.billingname.value = f.shippingname.value;
    f.billingcity.value = f.shippingcity.value;
}
function changeRadius1(){
    var name_input = document.getElementById('name_input').value;
    document.getElementById('radius1').innerHTML = name_input;
}
function changeRadius2(){
    var city_input = document.getElementById('city_input').value;
    document.getElementById('radius2').innerHTML = city_input;
}
</script> 

</head>
<body>
<b>Mailing Address FORM1</b><br><br>
<form name="form1">
Name:<input type="text" name="shippingname" onkeyup="FillBilling(form1); changeRadius1()">
<br>City:<input type="text" name="shippingcity" onkeyup="FillBilling(form1); changeRadius2()">
<br><br>
Name:<input type="text" id="name_input" class="name_input" name="billingname" onkeyup="FillBilling(form2)"><br>
City:<input type="text" id="city_input" class="city_input" name="billingcity" onkeyup="FillBilling(form2)">
</form>
<br>
<P>
<b>Billing Address FORM2</b><br><br>
<form name="form2">
Name:<input type="text" id="name_input" class="name_input" name="billingname"><br>
City:<input type="text" id="city_input" class="city_input" name="billingcity">
</form>

<br><b>Billing Address TEXT</b><br><br>
<div class="yourcode">Name: <span id="radius1"></span></div>
<div class="yourcode">City: <span id="radius2"></span></div>

</body>
</html>

I hope this is not a dumb question.. and the answer should be obvious.. but I’m at the beginning of JS.. so thank you for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T19:32:00+00:00Added an answer on June 13, 2026 at 7:32 pm

    I’m not entirely sure what you’re trying to accomplish, but I think I can help you:

    When you make the function calls in your 2nd set of fields in form1, FillBilling(form2), you are calling your FillBilling function with “f” being a reference to form2. form2 does not have inputs with the names “shippingname” and “shippingcity”. These are returning undefined.

    You need to rewrite your function so that it is accessing the forms you want to modify more specifically.

    You should also try not to reuse HTML names and IDs for the sake of the HTML’s validity and clarity when you’re programming. These things happen as a result.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

my code is <div id=fields> <form id=question-form> <input type=hidden name=question-main value=<?php echo mysql_prep($_GET['ques']);?> /></form>
foreach($apps as $app){ echo $this->Form->input('Application', array('type'=>'checkbox', 'id'=>$app['Application']['description'], 'div'=>false,'type'=>'checkbox','value' => $app['Application']['description'],'label'=>$app['Application']['description'])); } <div class=checkboxes> <input
I have the following email form: <form action=mailer.php method=post name=form1 id=form1 onsubmit=MM_validateForm('from','','RisEmail','name','','R','verif_box','','R','message','','R');return document.MM_returnValue> <table
I'm trying to echo a value in a form based on number of rows
i have the following code : <input type=text value=<?php echo $_GET['msg']; ?>> This input
While echoing a form from PHP with some predefined value retrieved from file from
Given the code below when I select a value from my dropdown box [S,
html in delete_define.php follows: <form action=delete_now.php onsubmit=my_funct();> <input type=submit name=my_submit class=my_submit value=submit/> </form> javascript
this is my entire PHP code: <?php if(empty($_POST['selid'])) {echo no value selected; } else
i have value in php variable like that $var='2.500000550'; echo $var what i want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.