1

I included a remote page in my website with iframe.

This page has tables.

I want to fill tables with Javascript in iframe view.

<form action="" method="post" onsubmit="return IsValidForm();" >
<input type="hidden"  name ="viewstate" value="HgIPYl1YWl1eXV9hHgViAAQHCQ4DAAMKHw4ZCh8OBgoFYRsCD2JfU1NhGwgfYlJhCB9iXVheW1JfWl5fWVxdW1JYXF5bYREEBQ5iWlldW1thCAYfCGJbYQ==" />
<input type="hidden"  name ="un" value="kolbehkhaterateman" />
<input type="hidden"  name ="chsm" value="160772526" />

<table cellpadding="2" width="450" border="0" style="text-align:right" id="tblc">
<tr>
    <td width="64">name:</td>
    <td width="372">
    <input id="txtwriter"  name="txtwriter" class="textbox"  onkeypress="return farsikey(this,event)"     onkeydown="changelang(this);" type="text" maxlength="50" value="" ></td>
</tr>
<tr>
    <td width="64">email:</td>
    <td width="372">
    <input id="txtemail"  name="txtemail" class="textbox"  dir="ltr" type="text" maxlength="50" value="" ></td>
</tr>
<tr>
    <td width="64">website:</td>
    <td width="372">
    <div style="FLOAT: left; WIDTH: 40px; HEIGHT: 20px; TEXT-ALIGN: left">
        <img class="Off" onmouseover="On(this)" onclick="ShowSM()" onmouseout="Of(this)" id="imgsm" height="18" src="http://www.blogfa.com/cmt/images/1.gif" width="18" border="0">
    </div>
    <input id="txturl" name="txturl" class="textbox"  dir="ltr"  type="text" maxlength="50" value="" ></td>
</tr>
<tr>
    <td width="100%" colspan="2">
     <textarea class="textarea" name="txtcomment"  id="txtcomment" onkeypress="return farsikey(this,event)"  onkeydown="changelang(this);"></textarea></td>
</tr>
<tr>
    <td width="100%" colspan="2"><input id="chkPrivate" type="checkbox" value="ON" name="chkPrivate" align="absmiddle"><label for="chkPrivate">urcomment 
        abs</label></td>
</tr>
<tr>
    <td width="100%" colspan="2"><input id="chkSave" type="checkbox" name="chkSave" align="absmiddle"><label for="chkSave">ur sciority </label>&nbsp;&nbsp;&nbsp;
    <a href="javascript:ClearCookie();" style="font-size:8pt">[remove info]</a></td>
</tr>
<tr id="captchaspace" style="visibility:hidden" >
    <td width="100%" colspan="2" height="24"  >  type this numbre:&nbsp;<input class="textbox"  dir="ltr" type="text" value=""  id= "txtCaptcha" name= "txtCaptcha" maxlength="6" style="width:70px;" align="absmiddle" onfocus="document.getElementById ('btnSend').disabled=false;"  autocomplete="off" >&nbsp;<span id="imgspace" ></span>

    </td>
</tr>


<tr><td width="100%" colspan="2" align=center height="18"><span style="font-size:7.5pt;color:gray"> nazar </span></td>  </tr>
<tr>
    <td align="left" width="100%" colspan="2" height="33">
    <input class="btn" id="btnSend" type="submit" value="submit" name="btnSend" >
    </td>
</tr>
</table>
</form>

How can I fill table fields with values?

Using Javascript or something.

I'm not too familiar with Javascript. Please shown me an example.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
user2563494
  • 189
  • 2
  • 9

1 Answers1

0

i included a remote page in my website with iframe.

Short answer is you can't modify a page from another domain. For security reasons browsers implement a "same origin policy". You can only edit the content of an iframe if it came from the same domain as the outer page. Otherwise people could do all sorts of nasty things like show a remote site's login page but change the post location to your own site, steal cookie values, etc.

LouD
  • 3,776
  • 4
  • 19
  • 17