Solved

iframe access permissions

Posted on 2014-04-17
2
264 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
2 Comments
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
Comment Utility
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
Comment Utility
Okay.

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

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Flexbox in CSS3 2 25
angularls and plnkr 14 17
jqplot Pie Chart 2 11
Bootstrap 3 icons 3 4
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.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now