Solved

iframe access permissions

Posted on 2014-04-17
2
270 Views
Last Modified: 2014-04-22
Dear Experts,

I am trying to load a web page like http://irctc.co.in in my html page by using iframe as shown in attachment.

Question:

1) I want to load textbox present in iframe loaded page with my custome value.
I am planning to enter 'User Name' & 'Password' textbox fields with my values and click the Submit button.

So let me know how i can achieve this either by jQuery, Javascripts or C# code behind.

2) Also I want to know how to save a webpage in my server and let me know if it can help by any ways for above issue.

Thanks in advance !

Cheers,

Shah
snapshot.JPG
0
Comment
Question by:Md Shah
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 53

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
ID: 40011832
You can not access the html in the iframe anymore than you could if it was not in an iframe.

If what you are trying to do is submit data to the form directly, you can view the code of the form and try and submit the data to the url in the action.

In this case, it looks like the url is https://www.irctc.co.in/cgi-bin/bv60.dll/irctc/services/login.do.  It is very possible they have code to prevent you from doing this.
<form method="post" action="https://www.irctc.co.in/cgi-bin/bv60.dll/irctc/services/login.do" name="LoginForm" autocomplete="off" style="margin:0; padding:0;" onsubmit="document.getElementById('button').disabled=true;">
  <input type="hidden" name="screen" value="home">
  <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tbody><tr>
    <td>
	<table width="96%" style="margin-top:10px; border-bottom:1px solid #ccc" border="0" cellspacing="0" cellpadding="3" align="center" class="txt1">

  <tbody><tr>
    <td width="40%">Username</td>
    <td width="1%">:</td>
    <td width="59%"><input type="text" name="userName" class="txtfld" autocomplete="off" size="12"></td>
  </tr>
  <tr>
    <td>Password</td>
    <td>:</td>
    <td><input type="password" name="password" class="txtfld" autocomplete="off" size="12"></td>
  </tr>
  <tr>
    <td colspan="3" height="1"></td>
  </tr>

  <tr id="hide_home">
    <td colspan="3" align="right">
	<input type="submit" name="button" id="button" class="buttonSubmit" value="Login" onclick="return validate();">	</td>
  </tr>


<tr>
<td align="right" colspan="3">

Open in new window


You can also search to see if there is an API to do what you want.  I found, http://pnrapi.alagu.net/ but it is not official.  

Good luck.
0
 
LVL 8

Author Closing Comment

by:Md Shah
ID: 40016469
Okay.

However, I found another way to achieve this instead of using iframe & it has worked without using any external API.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question