?
Solved

iframe access permissions

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

718 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