Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Us newbies need some help!! >.<

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Us newbies need some help!! >.<

Postby mini_dumbo » Mon Nov 25, 2002 8:15 pm

We're trying to do the following: :?

Say you have an input box, and the user types something in it and is prompted with a pop-up window with buttons "yes", "no" and "cancel", asking if he/she wants to save the changes... if user clicks yes, pop-up window will close and user will be returned to parent window with text in input box unchanged(i.e. origial text from inbox PLUS extra stuff typed in by user) , but if user clicks no, pop-up window will also close but instead of the previous case, only the original text(whatever was in it before user types anything) will remain in the box. We managed to do the "yes" case with some php codes but we're too much of a newbie in everything that we were so stuck from that point...

here's the most important part of the code....:mrgreen:

Submit Box: <br>
<?php
if ($userinput == "")
echo('<input name="userinput" onkeyup="show()" size="45" value="Quick fox" >');
else
echo('<input name="userinput" onkeyup="show()" size="45" value="'.$userinput.'" >');
?>

We don't know how to alter the above code so it'll do the job for the "no" case as well..... 8O


Any help will be greatly appreciated!! :D

Bo & Vic
User avatar
mini_dumbo
New php-forum User
New php-forum User
 
Posts: 8
Joined: Wed Nov 20, 2002 1:35 pm

Re: Us newbies need some help!! >.<

Postby mjr » Tue Nov 26, 2002 9:04 am

mini_dumbo wrote:We're trying to do the following: :?

Say you have an input box, and the user types something in it and is prompted with a pop-up window with buttons "yes", "no" and "cancel", asking if he/she wants to save the changes... if user clicks yes, pop-up window will close and user will be returned to parent window with text in input box unchanged(i.e. origial text from inbox PLUS extra stuff typed in by user) , but if user clicks no, pop-up window will also close but instead of the previous case, only the original text(whatever was in it before user types anything) will remain in the box. We managed to do the "yes" case with some php codes but we're too much of a newbie in everything that we were so stuck from that point...

here's the most important part of the code....:mrgreen:

Submit Box: <br>
<?php
if ($userinput == "")
echo('<input name="userinput" onkeyup="show()" size="45" value="Quick fox" >');
else
echo('<input name="userinput" onkeyup="show()" size="45" value="'.$userinput.'" >');
?>

We don't know how to alter the above code so it'll do the job for the "no" case as well..... 8O


Any help will be greatly appreciated!! :D

Bo & Vic



use javascript:opener.document.forms[0].reset() as action for NO button
mjr
New php-forum User
New php-forum User
 
Posts: 18
Joined: Fri Sep 27, 2002 6:35 am

:s... it doesn't work...

Postby mini_dumbo » Tue Nov 26, 2002 12:33 pm

Thanks for your suggestion, but it's still not working, are we supposed to put that line straight into our javascript code like this?

if(value == 'n')
{
opener.document.form[0].reset();
closewindow();

}

well anyway that's what we did and it didn't work... is it necessary to alter our php code(refer to first post above) ? or are we working in a totally wrong direction?? >.< Please help!!

If anybody else can give us a hand as well that'll be GREAT!! :cry:

Bo&Vic :D
User avatar
mini_dumbo
New php-forum User
New php-forum User
 
Posts: 8
Joined: Wed Nov 20, 2002 1:35 pm


Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron