Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

help with input area

Posted on 2003-11-03
4
Medium Priority
?
260 Views
Last Modified: 2013-12-13
Ok hi :)

i just wana know is it posible an exsample would not be harm :).

ok i have this input box and i need something like this, when this box change "onchange" its calls out php function wich will do something for exsample:

function world() {
       print("hellow world");
      }

.....

input type="text" name="world" onchange="world()"

.....
my exsample doesn't work :)


thx.
0
Comment
Question by:Kristao
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 

Expert Comment

by:php_user
ID: 9673367
Sorry, you are out of luck.
JavaScript is on the client side, PHP is on the server side. You will need to write a JavaScript function to emulate whatever the php function does.

0
 
LVL 1

Expert Comment

by:rstorey2079
ID: 9683546
If you absolutely need to get Javascript to trigger something in PHP, you have a few options, none of which are pretty:

- open a popup window (could be blocked, you could make it visible, or make it very very small)
- open a pop-under window (virtually invisible but could be blocked)
- use a hidden frame

any of these sound good?  if not, just make a new request to the server, do whatever you need to do, and bring the user back to the page she was on.   if you need to maintain some variables you can just pass them along in PHP...

hope that helps.
0
 
LVL 3

Accepted Solution

by:
red010knight earned 200 total points
ID: 9686582
Well the simplest thing to do would first:
input type="text" name="world" onchange="javascript:world()"

and create a spot on your page -preferably a text box as to keep things simple.
<input type="textbox" name="datadisplay" value="">

second:
insert this at the top of your page
<script language="javascript">
function world(){
  document.datadisplay.value="Hello world!"
}

This should get your desired affect - if you have a better example of what you are trying to do, it would help to better illustrate what you need and point to some preexisting javascript code that you could use.

Hope this helps,
Red010Knight
0
 
LVL 1

Author Comment

by:Kristao
ID: 9915933
sorry about this long time no answer :) but i dindn't get notice to my e-mail
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question