?
Solved

help with input area

Posted on 2003-11-03
4
Medium Priority
?
259 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
In this article we will learn how to backup a VMware farm using Nakivo Backup & Replication. In this tutorial we will install the software on a Windows 2012 R2 Server.
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

764 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