This topic is locked

New window and Field lookup

1/7/2007 3:38:38 PM
PHPRunner General questions
J
jwh45 author

I need to open pages in a new window (popup) so that information entered on the original form is available for review. I would like to have some information on the original form automatically filled into the new form (PK and FK data primarily. I intend to use the popups to post data to different tables in the DB.
I would also like to trigger the popup with a button on the original page. I have been trying to put some javascripts into the html but when I build it tends to crash the affected page.

Any ideas?

Thanks

J
Jane 1/8/2007

Hi,
I'm not sure that I understand you correctly.

Please give me more detailed description of what you're doing.

J
jwh45 author 1/8/2007

Hi,

I'm not sure that I understand you correctly.

Please give me more detailed description of what you're doing.


I am using a form to capture data from a phone caller (a la 911), I want to capture data on subforms without closing or changing the original form window. So I need the ability to open another add page in a popup window, add data and close the form (inserting the data into a different table). and still have the ability to add additional data to the original table.
I have four tables> Calltaker, Dispatcher, Vehicles, Persons. Original call data is captured to Calltaker, Then this data is used as the basis to dispatch a responding unit to the scene. But I need the ability to keep either or both of these two pages open while adding data to the Vehicles and Persons table, hence the popup. I want to be able to call it with a link (that part is easy) but I would like it to be a button instead of text. I am pretty sure that I can build everything if I can figure out where and how to put the code to pop up the window. But since I'm asking anyway, might as well ask for the world. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=14397&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />
Thanks

J
Jane 1/9/2007

I'm not sure that I understand you correctly.
To put new button on the ADD page proceed to the Visual Editor tab, turn on HTML mode, find this code:

<INPUT class=button id=submit1 type=submit value=Save name=submit1>

and add following lines just before:

<INPUT class=button id=addbutton onclick="java script: window.open('TableName_add.php');" type=button value=add name=addbutton>



where TableName is your actual table name.

J
jwh45 author 1/10/2007

I'm not sure that I understand you correctly.

To put new button on the ADD page proceed to the Visual Editor tab, turn on HTML mode, find this code:

and add following lines just before:

where TableName is your actual table name.


Thanks Jane,

It looks just like what I need except......it doesn't work.

I am sure my Apache and php.ini are correct because I can get a popup hand coding with this:
In page HEAD place function
<script LANGUAGE="JavaScript">
function Start(page) {

OpenWin = this.open(page, "CtrlWindow", "height=350,width=750, toolbar=no,menubar=no,location=yes,scrollbars=no,resizable=yes");

}

</SCRIPT>
Then in the body place:

<input type=button onClick="Start('recap.php')" value= <?php echo $laPer;?>
($laPer was from my language file in my old hand coded app.
So is there someplace I can stick the function and call it as needed?

J
jwh45 author 1/10/2007

Damn, this is embassassing. Javascript is one word. When I took out the space, it worked. Sorry <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=14459&image=1&table=forumreplies' class='bbc_emoticon' alt=':o' />

I
ictaylor 1/14/2007

Hi
I want to launch a popup from my original submit button - I dont want to add another button and basically want a pop up to launch when someone clicks submit AS WELL as being forwarded to the original 'registration sucessful' page
my current code for the button is:
<tr>

<td colspan=2 align=middle bgcolor="#2D57AB" width="289">

<p align="left">

<input type=hidden name=btnSubmit value="Register">



<input {$submitonclick} type=submit value="Submit" class=buttonM>

</p>

</td>

</tr>
If I try and add javascript in the <head></head> I get an error and the php doesnt run correctly

J
jwh45 author 1/14/2007

Hi

I want to launch a popup from my original submit button - I dont want to add another button and basically want a pop up to launch when someone clicks submit AS WELL as being forwarded to the original 'registration sucessful' page
my current code for the button is:
<tr>

<td colspan=2 align=middle bgcolor="#2D57AB" width="289">

<p align="left">

<input type=hidden name=btnSubmit value="Register">



<input {$submitonclick} type=submit value="Submit" class=buttonM>

</p>

</td>

</tr>
If I try and add javascript in the <head></head> I get an error and the php doesnt run correctly


You don't need to add javascript in the Header. The function is already contained in a function file. All you have to do is incorporate the code :

onclick="java script: window.open('TableName_add.php');"

Something like this: (I didn't run it so you might have to play with it some.)

<input {$submitonclick} onclick="java script: window.open('TableName_add.php');" type=submit value="Submit" class=buttonM>
When you get it to work, post the code back here. I can always use a new way to skin a cat. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=14557&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />

I
ictaylor 1/14/2007

I cant get it to work no matter what I do...... it doesnt error but just doesnt do anything.
do you think {$submitonclick} needs to be edited so it includes onclick="java script: window.open('TableName_add.php');" in its onclick parameters
if so where is {$submitonclick} located?