Results 1 to 2 of 2

Thread: check textfield in an iframe

  1. #1
    Join Date
    Dec 2008
    Location
    Fremont, CA
    Posts
    30
    Thanks
    1
    Thanked 7 Times in 7 Posts

    Default check textfield in an iframe

    Hi all,

    I have an page with an iframe, and the iframe src file has few textfields and i want to get at that. how do i get its values?

    for example:

    page A:

    <html>
    <head>
    <script type="text/javascript">
    <!--
    function convertText() {
    document.SampleForm.myText.value = document.SampleForm.myText.value.toUpperCase()
    }
    -->
    </script>
    </head>
    <iframe scrolling="no" src="po.php" name="fr1" id="fr1"></iframe>
    </html>


    po.php has a textfield[myText]. I want to get at this value. any help would be appreciated it.

    Best,
    Kris

  2. #2
    Join Date
    Dec 2008
    Location
    Fremont, CA
    Posts
    30
    Thanks
    1
    Thanked 7 Times in 7 Posts

    Default

    ok, i made an example code to help me get an understanding. Looks ok, except for one problem. When the user hits submit, the form should do its post. I want to get at the textfield only when the user trys to go to a different page.

    This is wht i have so far:

    HTML Code:
    <html>
    <head>
    <title>Untitled Document</title>
      <script type="text/javascript">
      <!--
        function convertText() {
          var x = document.SampleForm.myText.value;
    	  if(x == ""){
    	  alert("Nothin");
    	  }else{
    	  confirm("Unsaved Data");
    	  }
       }
      -->
      </script>
    </head>
    
    <body onunload="convertText()">
      <form name="SampleForm" action="abc.php">
        <input type="text" name="myText">
        <input type="submit" value="Convert"  >
      </form>
    </body>
    </html>
    any help would be great.

    Rgds,
    Kris

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
  •