Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jul 2005
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Passing Variable

    Hi All,

    Hoping someone can help me here..

    I have a php page which is creating a form with the following content :

    <form name="editSASummary" action="editSummary.php" method="post">

    <select name="stockId">
    <option value="670">Fasson 60# Cast Glos</option>
    <option value="670">Fasson 60# Cast Glos</option>
    <option value="100">Marks Stock</option>
    </select>

    <a href="#" onClick="window.open('editSummary.php?action=viewStock&stockId=' + document.forms.editSummary.stockId.value, null, 'windowX=10,windowY=10,width=440,height=630')">View Spec</a>

    </form>

    Problem is the javascript isn't paasing the stockId code to the end of the URL.
    Is there something arey with the code?
    I'm not getting any errors in the Javascript console.

    tia, Will

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,043
    Thanks
    0
    Thanked 251 Times in 247 Posts
    Code:
    <script type="text/javascript">
    function  createPopup(popupName){
      var w = window.open("", popupName, "left=10, top=10, width=440, height=630");
      w.focus();
    }
    </script>
    ...
    <form name="editSASummary" action="editSummary.php" method="get" target="popup" onsubmit="createPopup(this.target)">
    <input type="hidden" name="action" value="viewStock" />
    <select name="stockId">
    <option value="670">Fasson 60# Cast Glos</option>
    <option value="670">Fasson 60# Cast Glos</option>
    <option value="100">Marks Stock</option>
    </select>
    
    <input type="submit" name="btnSubmit" value="View Spec" />
    
    </form>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •