I need ur help....

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
umanda
Forum Newbie
Posts: 1
Joined: Wed Feb 03, 2010 4:24 am

I need ur help....

Post 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..?
jaiswarvipin
Forum Commoner
Posts: 32
Joined: Sat Sep 12, 2009 3:43 pm
Location: India

Re: I need ur help....

Post 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
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: I need ur help....

Post 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.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply