Popup Box for special text field GURU help needed

Discussion in 'JavaScript' started by geomodules, May 8, 2006.

  1. #1
    I need help from a GURU....

    This opens the pop up box
    
    <form method=post action='' name=state>
    <table border=0 cellpadding=0 cellspacing=0 width=550> <tr>
    <td ><font size=2 face='Verdana'>Your Name</font>
    <input type=text name='p_name' size='8'>
    <a href="javascript:void(0);" NAME="My Window Name" title=" My title here " onClick=window.open("child3.html","Ratting","width=550,height=170,left=150,top=200,toolbar=1,status=1,");>Click here to open the child window</a>
    </td></tr> </table></form> 
    
    Code (markup):
    This is the child3.html code

    
    <html>
    <head>
    
    <script langauge="javascript">
    function post_value(){
    opener.document.state.p_name.value = document.frm.me.value;
    self.close();
    }
    </script>
    
    <title>(Type a title for your page here)</title>
    </head>
    
    
    <body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">
    
    
    <form name="frm">
    
          
    <select name="me">
    <option value="AR">AR</option>
    <option value="MN">MN</option>
    <option value="CA">CA</option>
    </select>
    
    
    
    
    <table border=0 cellpadding=0 cellspacing=0 width=250>
    
    
    <tr><td align="center"> Your name
    <input type=button value='Submit' onclick="post_value();">
    </td></tr>
    </table></form>
    
    
    
    Code (markup):

    Now this works great..... My problem is this... I am sending the info to text box. Which this should work. Except my text name has square brackets...

    
    <input type=text name=c[optional_field_1] value="" size=2 maxlength=2 class=data_field_values>
    
    Code (markup):
    Now the ME field I should just have to put in c[optional_field_1] and it should work. I can't rename this field so I have no choice but to find a way for java script to work with it some how....

    My form name is. <form name=registration_form
    text field to send to. c[optional_field_1]

    I plan to have 6 popups using a different field.
    c[optional_field_1]
    c[optional_field_2]
    c[optional_field_3]
    c[optional_field_4]
    c[optional_field_5]
    c[optional_field_6]

    For some reason Java script does not like those SQUARE brackets. I am new. So any help would be great.

    thx...:cool:
     
    geomodules, May 8, 2006 IP
  2. torunforever

    torunforever Peon

    Messages:
    414
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try this in the popup window:

    opener.document.registration_form.elements['c[optional_field_1]'].value = document.frm.me.value;
     
    torunforever, May 8, 2006 IP