Page 1 of 1

I need ur help....

Posted: Wed Feb 03, 2010 4:26 am
by umanda
I have a form with 2 textboxs. with js handling

Code: Select all

<script type = "text/javascript">
function autofill(which) {
document.getElementById("text2").value = which;
}
</script>
<input type="text" name="text1" onblur="autofill(this.value)" />
<input type="text" name="text2" />
So According the above js, when user type some thing on text1 text box automatically update it to the text2 text box...

My question is how I handle this case by php..?

Re: I need ur help....

Posted: Thu Feb 04, 2010 4:59 am
by jaiswarvipin
There is many way to do this
and
1) Use AJAX in the PHP and on every blure you can call the function whcih posting or refreshing the page.
2) user Post method and after post, in text box2 pelase added this line

Code: Select all

value="<?php $_POST['text1']?>"
.
3)use you code only and but after making some correction in that you can use in the php file because in the PHP Javascript is work like

Code: Select all

 
<script language="Javascript">
<!--
function autofill(valueOfObject)
{
document.getElementById("text2").value = valueOfObject;
}
-->
</script>
<body>
input type="text" id="text1" onblur="autofill(this.value)" />
<input type="text" id="text2" />
 
</body>
 



4) you can you the get methid also. refer to point 2

Re: I need ur help....

Posted: Thu Feb 04, 2010 3:57 pm
by pickle
Welcome to the boards.

Please use the [ code ] tags to wrap your code & take time to read the rules - namely:
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:2. Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:1. Select the correct board for your query. Take some time to read the guidelines in the sticky topic.
This thread has been moved to the PHP - Code forum.