Solved

help with input area

Posted on 2003-11-03
4
258 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 50 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

VM backup deduplication is a method of reducing the amount of storage space needed to save VM backups. In most organizations, VMs contain many duplicate copies of data, such as VMs deployed from the same template, VMs with the same OS, or VMs that h…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

691 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