This topic is locked

add page as popup or ajax only?

1/25/2009 11:32:44 PM
PHPRunner General questions
W
wildwally author

Does anyone know how to get the add page to open up in a new seperate window? Without all the menu and navigations would be great, but not necassary.
I'm thinking along the lines of a before record added, that it would look at a record and if it is true then it would do it. I was able to get this to redirect, but not in new window.
// Parameters:

// $values - Array object.

// Each field on the Add form is represented as a 'Field name'-'Field value' pair

if($values["LOGISTICS_REQUEST"] == 1)

{

//** Redirect to another page ****

header("Location: logistics_add.php");

exit();

}

Else

{

}

return true;
// return true if you like to proceed with adding new record

// return false otherwise

J
Jane 1/26/2009

Hi,
use List page: Before display event on the Events tab for this purpose.

Here is a sample:

$xt->assign("addlink_attrs","href=\"TableName_add.php\" onClick=\"window.open('TableName_add.php');\"");

W
wildwally author 1/28/2009

What exactly is this suppose to do?

J
Jane 1/28/2009

This code opens add page in the new window.

W
wildwally author 1/28/2009

Through A link? or my code simialar to the example I provided above?

J
Jane 1/28/2009

Hi,
to open new window in the AfterAdd event use this code:

if($values["LOGISTICS_REQUEST"] == 1)

{

?><script>

window.open('logistics_add.php');

</script><?php

}

W
wildwally author 1/28/2009

Thanks again Jane <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=37231&image=1&table=forumreplies' class='bbc_emoticon' alt=':rolleyes:' />