Jump to content
php.lv forumi

Nepieciešams nosūtīt form datus no popup loga


Uldis

Recommended Posts

Sveiki, ir radusies nepieciešamība no popup formas saņemt datus mātes tabā. Respektīvi, lai aizpildot popup formu es varētu datus pārsūtīt uz pamatlapu. Pagaidām man izdodas pārlādēt parent lapu, nospiežot submit popup logā. Bez nezinu kā varētu nosūtīt arī fomas datus. Esmu ticis tik tālu :

 

Parent.php

 

<html>

<script language=javascript>

window.name = "doUpLoadProc";

</script>

 

<body></body>

<?php echo time();?>

</html>

 

Popup.php

 

<html>

<head>

<script language="javascript">

function doUpload() {

form.submit();

self.close();

window.close();

}

</script>

</head>

<body>

<form method="post" name="uploadnew" target="doUpLoadProc" action="http://www.nomnieks.lv/parent.php" onsubmit="doUpLoad();">

<input type='text' id='tb' value='Rīga' name='pilseta' size='20' autocomplete='off'

/>

<input type="submit" value="Nosūtīt"/>

</form>

</body>

</html>

Edited by Uldis
Link to comment
Share on other sites

Vispirms caur parent to popup ir jāatver (window.open), un tad tikai šis skaitīsies kā popups (kā arī darbosies self.close()).

Un no popupa parentam tad varēs tikt klāt ar window.opener

 

Variants ir uztaisīt formu parentā ar hidden laukiem un popupā ielikt onsubmit, lai nokopē visus laukus uz parenta formu, un tad varēs submitot parenta formu.

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...