Solved

help with input area

Posted on 2003-11-03
4
244 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
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

How to update Firmware and Bios in Dell Equalogic PS6000 Arrays and Hard Disks firmware update.
Workplace bullying has increased with the use of email and social media. Retain evidence of this with email archiving to protect your employees.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will walk an individual through the process of installing the necessary services and then configuring a Windows Server 2012 system as an iSCSI target. To install the necessary roles, go to Server Manager, and select Add Roles and Featu…

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now