Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

iframe access permissions

Posted on 2014-04-17
2
Medium Priority
?
284 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 54

Accepted Solution

by:
Scott Fell,  EE MVE earned 1500 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

This article discusses four methods for overlaying images in a container on a web page
This article discusses how to implement server side field validation and display customized error messages to the client.
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…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

885 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