SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jun 2004
    Location
    Coeur d'Alene, ID
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    problem popup form

    I've got a great popup window for my form but it can't handle a hidden value. What do I change in the code below to make my hidden country field appear on the main window?

    Code:
    <html>
    <head>
    	<title>U.S. Address</title>
    <script language="Javascript" type="text/javascript">
    <!-- hide script from old browsers
    function updateParent1(textField){
    opener.document.contactinfo.address.value=textField.value
    }
    function updateParent2(textField){
    opener.document.contactinfo.city.value=textField.value
    }
    function updateParent3(textField){
    opener.document.contactinfo.state.value=textField.value
    }
    function updateParent4(textField){
    opener.document.contactinfo.zip.value=textField.value
    }
    function updateParent5(textField){
    opener.document.contactinfo.country.value=textField.value
    }
    // end hiding -->
    </script>
    </head>
    
    <body>
    <form action="none" onSubmit="window.close()">
    address: <input type="text" onblur="updateParent1(this)"><br>
    city: <input type="text" onblur="updateParent2(this)"><br>
    state: <input type="text" size="2" maxlength="2" onblur="updateParent3(this)"> zip: <input type="text" onblur="updateParent4(this)"><br>
    country: USA<br><br>
    <input type="hidden" value="USA" onblur="updateParent5(this)">
    <input type="submit" name="submit">
    </form>
    
    </body>
    </html>

  2. #2
    SitePoint Zealot Valera Selev's Avatar
    Join Date
    Apr 2004
    Location
    Lviv, Ukraine
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by tachyon
    I've got a great popup window for my form but it can't handle a hidden value. What do I change in the code below to make my hidden country field appear on the main window?
    The onblur action for this input won't work:
    <input type="hidden" value="USA" onblur="updateParent5(this)">

    Since the field is hidden and it won't be updated by user, you many write an inline script after the form which would call the updateParent5() function.


Bookmarks

Posting Permissions

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