javascript solution needed

Javascript coding ..

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 124
Joined: Sun Feb 29, 2004 6:26 am

javascript solution needed

Postby kiwi » Sun Jul 04, 2010 11:57 pm

i have this problem, i got a problem in a object tag, try to set value from the page , but cant work, error appear.

form a.php
part of the code:

<div><object id="ifValidate" data="validate.php?xf_sid=0000000060" style="display:" type="text/php"></object></div>

in form validate.php
part of the code:
echo "<script type=\"text/javascript\">";
echo " parent.ifValidate.text_id.value='1234';";
echo "</script>";

the field text_id is located in a.php
any one know how to set the value to the a.php from validate.php(located in object tag)

if the object tag replace with iframe, it work, i try this before, but xhtml doest allow iframe.
and the browser use is IE, i try getElementById and it work for firefox and not in IE

any solution, thanks

New php-forum User
New php-forum User
Posts: 2
Joined: Mon Jul 12, 2010 9:21 am
Location: New Delhi, India

Re: javascript solution needed

Postby jatinsethi » Mon Jul 12, 2010 8:38 pm

It works for iframe because basically your iframe will load that validate.php and the script inside validate.php will be executed.
I am not much familiar with object tag, but I am sure about it that if you want to execute php script you have to load that page again.
Your iframe does the same. Try using AJAX, so that you send request from your current page to validate.php and get the values to your current page. Don't know much I am a newbie. :)

[sry in advance if it does not work or I din got your problem. :(]

Return to “JavaScript”

Who is online

Users browsing this forum: No registered users and 1 guest