Click here to Skip to main content
15,890,947 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have this java script :

function set()
{
window.document.editCustomer.IDs.value = window.document.searchCustomer.IDs.value;
window.document.searchCustomer.IDs.value = 000000000;
}

and in the body i have
<body >
.
.the forms
.
</body>

now i have this form lets call it form one ok :
HTML
<form name="searchCustomer" method="post" action="editCustomer.asp">
    <td align=right>
        <b>emeter id to delete: </b>
        <input name="IDs" type="text" size="15"/>
    </td>

    <td align=right>
        <input name="search" type="submit" value="serach"/>
    </td>
</form>


all work fine the text become 000000 when i load the page.

this is form two :


HTML
<form name="editCustomer" method="post"  onsubmit="return checkForm();" action="helpdelete.asp">
			
				<table cellspacing="15px"  border="0" align="center">
						
						<tr>
						<td align=left>id : </td>
						<td align=left><input name="IDs" type="text"/></td>
						</tr>
						
						
						.
						.
						.
								</table>
						<center><input name="edite" type="submit" value="edite"/></center>
					</br>
		</form>



and i want when i click search in form one the text input(name = "IDs") in form two become equal to the text input in form one (name = "IDs")

****in java script
****both the forms one and twp are in the same html page

What I have tried:

when i tried to wirte the same input in form two the edite is working

but i want automaticaly the both of the become equals when i click in search button at form one
Posted
Updated 1-Apr-16 0:58am

1 solution

You need to assign your two textboxes different ID's say
HTML
<input ID="IDs" type="text" size="15"/>

and
HTML
<input ID="IDs2" type="text" size="15"/>

then
HTML
document.getElementById("IDs2").value = document.getElementById"IDs").value
 
Share this answer
 
Comments
komokom 1-Apr-16 6:59am    
its dont working its steall blink(empty)
Wombaticus 1-Apr-16 7:13am    
I assume you've added
onclick="set()"
to the search button? And updated your javascript as I suggested?
komokom 1-Apr-16 7:18am    
ohhhh lol i foget it now its working
ty very much

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900