Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
pass value from a textbox to a javascript confirmation popup.
Old 04-20-2006, 12:35 AM pass value from a textbox to a javascript confirmation popup.
waller's Avatar
Skilled Talker

Posts: 59
Location: North Borneo.
Trades: 0
How can I do this? I want to grab values from textboxes in a page and when I hit the submit button, I want a confirmation popup to appear and show the values from the textboxes.
__________________
$id ="waxxer";
$id = str_replace('x', 'l', $id);
echo $id;
echo " and Marj";
waller is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-20-2006, 04:17 PM Re: pass value from a textbox to a javascript confirmation popup.
rogem002's Avatar
PHP Chap

Posts: 843
Name: Mike
Location: United Kingdom
Trades: 0
I've been wanting something simlar. What i've been wanting is a preview button what basicly sends some form infomation into a popup.

-- Edit --

Found a way to do it

Code:
function preview() { 

temp = document.NewPage.text.value; 
window.open('admin.php?p=pop_preview&text=' + temp,'Preview','toolbar=0,scrollbars=0,location=0,width=300,height=400,resizable=0')
}; 

</script>
					  <input class="button" name="Preview" value=" Preview " onclick="javascript:preview();" type="button" />
You need to change the
temp = document.NewPage.text.value;
NewPage (Form name) and text (field Name) to your fields.

And the
admin.php?p=pop_preview&text=
to your URL
__________________
My Blog/Site:
Please login or register to view this content. Registration is FREE

Last edited by rogem002; 08-20-2006 at 04:46 PM.. Reason: Found out how to do it :)
rogem002 is offline
Reply With Quote
View Public Profile Visit rogem002's homepage!
 
Old 08-24-2006, 07:41 AM Re: pass value from a textbox to a javascript confirmation popup.
Ultra Talker

Posts: 256
Location: Auckland, New Zealand
Trades: 0
Maybe this is similar to your needs:

HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-NZ">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Javascript Confirmation with Textbox Values</title>
    <script type="text/javascript">
    /*<![CDATA[*/
    function confirm_results(theform) {
      var text = '\n';
      var inputs = theform.getElementsByTagName('input');
      for(var i = 0, n = inputs.length - 1; i < n; i++)
      {
        text += inputs[i].value + ' ';
      }
      confirm('Are these details correct? ' + text);
    }
    /*]]>*/
    </script>
    <style type="text/css">
      #theform ul {
        list-style: none;
      }
      #theform li {
        display: inline;
      }
    </style>
  </head>
  <body>
    <form id="theform" action="" method="post" onsubmit="javascript:confirm_results(this);">
      <fieldset>
        <legend>Your Name Entry</legend>
        <ul>
          <li><label for="fname">First:</label> <input id="fname" name="fname" type="text" /></li>
          <li><label for="mname">Middle:</label> <input id="mname" name="mname" type="text" /></li>
          <li><label for="lname">Last:</label> <input id="lname" name="lname" type="text" /></li>
        </ul>
        <p><input id="submit" name="submit" type="submit" value="Send" /></p>
      </fieldset>
    </form>
  </body>
</html>
Although it makes it easy knowing what you require and just grabbing those values, in this case I grabbed all inputs and just removed the last one which was the submit button. Hopefully this will help you have some idea of what you could do.

Cheers,

MC
__________________
#------------------------------signature---------------------------------------------------------------------------------#
Quote:
I am well recognised for what I don't do than what I do. Chores are just one of those things.

Last edited by mastercomputers; 08-24-2006 at 07:42 AM..
mastercomputers is offline
Reply With Quote
View Public Profile Visit mastercomputers's homepage!
 
Old 08-25-2006, 07:21 PM Re: pass value from a textbox to a javascript confirmation popup.
kIDJOE's Avatar
Extreme Talker

Posts: 186
Location: Hollywood, CA
Trades: 0
yeah just POST submit them to the PopUp window or... window.open (PopUp window) pop.html?variable1=document.FORMNAME.FIELD.value or $variable1 ..... in PHP

yeah?
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

kIDJOE is offline
Reply With Quote
View Public Profile Visit kIDJOE's homepage!
 
Reply     « Reply to pass value from a textbox to a javascript confirmation popup.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13722 seconds with 12 queries