Solved

iframe access permissions

Posted on 2014-04-17
2
274 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

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Suggested Courses

617 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