Accessing the FORM tag with Javascript.
I ran into the following problem when writing the customization portion of a Java portlet.
I have some JavaScript that I would like to have run when the customization form is submitted (ie, when the user clicks OK or APPLY).
Normally, this is easy to do by specifying the 'onSubmit' event on the <FORM> tag. But I don't seem to have access to the FORM tag
since it's being generated on the fly by Oracle Portal.
So, how do I set up my code/portlet so that I can have some Javascript executed due to the onSubmit event?
I may not be understanding the problem correctly so you may have already tried this:
You should be able to dynamically adjust any form tag's attributes after the form's been generated, you just need to know how it's identified. If Portal isn't assigning it a consistant name you can use, you still might be able to adjust it. If you can place a piece of code "inside" the form, you could access the form tag with: "this.form.onSubmit = ..." That might be your best bet, but the "this" scope can be weird if I remember right. If you don't know that your code will always be inside the form tags, your other choice would be to write a function that will iterate over each form in the frameset and test for a input field name/value that you know is unique to your form. Then you'll be able to identify the form, and finally set the onSubmit value to whatever you want.
Here's some pseudo javascript (I'm too lazy to go grab my reference guide to refresh my memory about the actual syntax you'd use) that might get you started:
foreach form in parent.forms {
if (form.foobar.value == "myUniqueValue") {
var gotmyform = form;
I think. :) It's been a while since I've done such a thing, but that's what I remember.
I don't know squat about Portal (that's why I'm here poking at these forums), so I could be completely off base. If so, I'm sorry.
Good luck,
Sean
null
Similar Messages
-
How to use Direct Access URL in the FORM tag
I want to substitute the pageid url (/servlet/page?_pageid=161&_dad=portal30&_schema=PORTAL30) with the direct access urls (pls/portal30/url/page/my_page) to address the pageid conflict between development server and production server.
It works perfectly fine in the redirection code such as:
self.location.href="/pls/portal30/url/page/next_page". But I got "Page can not be found" error message when I use it in the <FORM> tag:
<FORM ACTION="/pls/portal30/url/page/next_page" METHOD="POST" NAME="my_form">
Does anyone out there know how to use the direct access url inside the <FORM> tag? I am trying not to write a bunch of code just to retrieve and insert the pageid at the run time.
Thanks in advance.
ArthurUse condition. If you are validating a record, just out the desired check in the condition field for that specific item.
Thanks
Nagamohan -
The question says it all:
What Are The Minimum Permissions In Order An User To Be Able To Access User Profile Data With JavaScript And REST API.?
In the User Profile -> Permissions there is only the option for "Full Control".Hi Nikolay,
Thanks for posting your issue, you need to set permissions on User Profiles = Read. Kindly find the below mentioned URLs to get the code and more details on this.
http://www.vrdmn.com/2013/02/sharepoint-2013-working-with-user.html
http://www.vrdmn.com/2013/07/sharepoint-2013-get-userprofile.html
http://sharepoint.stackexchange.com/questions/61714/sharepoint-2013-call-the-rest-api-from-sharepoint-hosted-app
http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2013/04/09/how-to-query-sharepoint-2013-using-rest-and-javascript.aspx
I hope this is helpful to you, mark it as Helpful.
If this works, Please mark it as Answered.
Regards,
Dharmendra Singh (MCPD-EA | MCTS)
Blog : http://sharepoint-community.net/profile/DharmendraSingh -
How do I use dynamic JSP vars in a form tag with implicit sessions?
I'm using iAS 6 SP4 and 'lite' sessions w/ sticky LB on Win2K for development and need to use a dynamic variable (via an = scriptlet) to specify the URL a form tag's ACTION method posts to. The implicit URL session encoding attempts to add the hidden input tags to the form but part of it is getting cut off. If I remove the dynamic var scriptlet from the form tag it works fine. How can I use dynamic vars and implicit URL session encoding?
Here's my code sample:
<FORM NAME='Create' METHOD='POST' ACTION='<%= servletRootStr %>CreateServlet' TARGET='_top'>
Output is:
<FORM NAME='Create' METHOD='POST' ACTION='http://my.server.com/NASApp/WebStuffApp/Create' TARGET='_top'>T NAME="GXHC_gx_session_id_" TYPE="HIDDEN" VALUE="GXLiteSessionID--8351372849698357580" ></INPUT><INPUT NAME="GXHC_GX_jst" TYPE="HIDDEN" VALUE="d692bc3d662d6164" ></INPUT>
Because the <INPUT> tagon the first session var is cut off, up to the T, the page obviously fails. Can this be fixed with a config setting, or is it a bug in iPlanet??Thanks for helping me Anurag.
The problem I tried to solve was that I want the result from my service methods
in XML format. I thought a callback/polling was the best alternative, am I right?
Since the callback option doesn´t work I will try to poll the service.
Are there any other options for solving my problem??
Thanks again!!
/A
"Anurag Pareek" <[email protected]> wrote:
>
Andrej,
I guess you are trying to invoke a Webservice which defines a callback
method
from a JSP, and want the JSP to handle the callback made by the webservice.
For a client to be able to handle a callback made by a Webservice, it
has to be
a web service in itself.
Even some web service tools do not support 'Solicit responses' and hence
they
would not generate handlers for the callback methods by default. You
can download
a callback WSDL in such cases and implement it on the client side. The
server
side web service will then callback to that webservice.
The other option to callbacks is to use polling methods. This can be
done from
any client such as Java client/ JSP client or a .NET client.
Hope this helps. Let me know if you have any further questions.
Regards,
Anurag
"Andrej" <[email protected]> wrote:
I´ve tried this but with no success..
How do I recieve the data in a servlet/JSP-page?
Thanks. -
Hi,
I have written code for 'Export To Excel' in the visual web part as below
//ascx file
<table>
<tr>
<td>From Date:</td>
<td><SharePoint:DateTimeControl ID="dtFromDate" runat="server" DateOnly="True" /></td>
</tr>
<tr>
<td>To Date:</td>
<td><SharePoint:DateTimeControl ID="dtToDate" runat="server" DateOnly="True" TimeOnly="False" /></td>
</tr>
<tr>
<td>Report Type:<asp:DropDownList ID="ddlreporttype" runat="server"><asp:ListItem>Consolidated</asp:ListItem><asp:ListItem>Question Wise</asp:ListItem></asp:DropDownList></td>
<td>
<br />
<asp:GridView ID="gvwikireport" runat="server">
</asp:GridView>
</td>
</tr>
<tr>
<td><asp:Button ID="btnExportToExcel" runat="server" Text="Export To Excel" OnClick="btnExportToExcel_Click"/></td>
</tr>
</table>
//cs file
protected void Page_Load(object sender, EventArgs e)
if (!Page.IsPostBack)
BindGridview();
private void BindGridview()
DataTable dt = new DataTable();
dt.Columns.Add("UserId", typeof(Int32));
dt.Columns.Add("UserName", typeof(string));
dt.Columns.Add("Education", typeof(string));
dt.Columns.Add("Location", typeof(string));
dt.Rows.Add(1, "SureshDasari", "B.Tech", "Chennai");
dt.Rows.Add(2, "MadhavSai", "MBA", "Nagpur");
dt.Rows.Add(3, "MaheshDasari", "B.Tech", "Nuzividu");
dt.Rows.Add(4, "Rohini", "MSC", "Chennai");
dt.Rows.Add(5, "Mahendra", "CA", "Guntur");
dt.Rows.Add(6, "Honey", "B.Tech", "Nagpur");
gvwikireport.DataSource = dt;
gvwikireport.DataBind();
protected void btnExportToExcel_Click(object sender, EventArgs e)
Page.Response.ClearContent();
Page.Response.Buffer = true;
Page.Response.AddHeader("content-disposition", string.Format("attachment; filename={0}", "WikiReport.xls"));
Page.Response.ContentType = "application/ms-excel";
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
gvwikireport.AllowPaging = false;
BindGridview();
//Change the Header Row back to white color
gvwikireport.HeaderRow.Style.Add("background-color", "#FFFFFF");
//Applying stlye to gridview header cells
for (int i = 0; i < gvwikireport.HeaderRow.Cells.Count; i++)
gvwikireport.HeaderRow.Cells[i].Style.Add("background-color", "#df5015");
gvwikireport.RenderControl(htw);
Page.Response.Write(sw.ToString());
Page.Response.End();
But after clicking the 'Export To Excel' button i am getting the below error
Control 'ctl00_SPWebPartManager1_g_d4fb972b_26ec_4065_9c89_80b51b384492_gvwikireport' of type 'GridView' must be placed inside a form tag with runat=server.
In case if i am modifying the code as below I am getting error as 'page can have only one server tag'.
<form id="frmgrdview" runat="server">
<asp:GridView ID="gvwikireport" runat="server">
</asp:GridView></form>
So please share your ideas/thoughts on the same.
Regards,
Sudheer
Thanks & Regards, SudheerHi,
According to your post, my understanding is that you fail to export to excel.
I create a demo as below, it works well.
<table>
<tr>
<td>
<asp:Label ID="Label1" runat="server" Text="Name"></asp:Label>
</td>
<td>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:GridView ID="gvwikireport" runat="server">
</asp:GridView>
</td>
<td>
<br />
<asp:Button ID="btnExportToExcel" runat="server"
onclick="btnExportToExcel_Click" Text="Export to excel" />
</td>
</tr>
</table>
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data;
using System.IO;
namespace Export_to_Excel.VisualWebPart1
public partial class VisualWebPart1UserControl : UserControl
protected void Page_Load(object sender, EventArgs e)
if (!Page.IsPostBack)
BindGridview();
private void BindGridview()
DataTable dt = new DataTable();
dt.Columns.Add("UserId", typeof(Int32));
dt.Columns.Add("UserName", typeof(string));
dt.Columns.Add("Education", typeof(string));
dt.Columns.Add("Location", typeof(string));
dt.Rows.Add(1, "SureshDasari", "B.Tech", "Chennai");
dt.Rows.Add(2, "MadhavSai", "MBA", "Nagpur");
dt.Rows.Add(3, "MaheshDasari", "B.Tech", "Nuzividu");
dt.Rows.Add(4, "Rohini", "MSC", "Chennai");
dt.Rows.Add(5, "Mahendra", "CA", "Guntur");
dt.Rows.Add(6, "Honey", "B.Tech", "Nagpur");
gvwikireport.DataSource = dt;
gvwikireport.DataBind();
protected void btnExportToExcel_Click(object sender, EventArgs e)
Page.Response.ClearContent();
Page.Response.Buffer = true;
Page.Response.AddHeader("content-disposition", string.Format("attachment; filename={0}", "WikiReport.xls"));
Page.Response.ContentType = "application/Excel";
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
gvwikireport.AllowPaging = false;
BindGridview();
//Change the Header Row back to white color
gvwikireport.HeaderRow.Style.Add("background-color", "#FFFFFF");
//Applying stlye to gridview header cells
for (int i = 0; i < gvwikireport.HeaderRow.Cells.Count; i++)
gvwikireport.HeaderRow.Cells[i].Style.Add("background-color", "#df5015");
gvwikireport.RenderControl(htw);
Page.Response.Write(sw.ToString());
Page.Response.End();
The result is as below:
Best Regards,
Linda Li
Linda Li
TechNet Community Support -
It looks like your problem is at the beggining in the form tag, specificall
Hello,
I'm having an issue with a cgi form that I created (added on to a website I created using iWeb). Basically, here's the problem: I'm not sure if I have to FTP it over to mac in order for it to work, but if someone could let me know if that's the issue, I'd appreciate it. Basically, when any client hits the submit button on my site to fill out a quote request, it DOES NOT go into my inbox. Why?
Here's the html code:
http://yourdomain.com/cgi-bin/FormNewMail.cgi
Below is a comment I received from someone who thought they knew where the problem was.
"It looks like your problem is at the beginning in the form tag, specifically
this part:
action="http://yourdomain.com/cgi-bin/FormNewMail.cgi"
When I type in that address, the correct page isn't loading, which probably
means you haven't uploaded the actual "FormNewMail" script to your cgi-bin
folder (at Webintellects).
Anyone care to tackle this one?
Thx,
JWhat exactly does iWeb support as far as html forms then?
Search this forum for "form".
http://discussions.apple.com/thread.jspa?messageID=7650084� -
HELP! I subscribed to imatch on my mac so that I could access the songs anywhere with my iphone. However since I live in a rural community I would like to make playlists that always stay on my phone in case I don't have service. Not sure how.
I have the same issue. While I am sure your solution would work, my playlist has over 6,000 songs and hiting every song to download it is not very practical. Is there another way?
I am looking to have a subset of my music physically on my phone so that I can play it without internet access, but have access to the entire library when I do have internet access. -
Can I setup username(s) and password(s) for accessing the form?
Dear all,
As the title states, is it possible to restrict the form access to certain people by setting up usernames and passwords?
If not, what would be a suitable (and similar) alternative to using quick reporting forms in a company environment that would allow trend analysis?Thank you for your response,
True as it may, I don't want anyone accessing the form except those authorized. For example, even though the form access can be limited by controlling the dirstribution of a URL, a quick google search of "incident report formscentral" produces a link to the Columbus School District Bully Incident Reporting Form on the first page of results!
In order to limit access, is it possible to Only embed the form on other websites (ones that require authentication), or to only use the PDF version of the form, allowing it to upload the data to formscentral? -
How to know the forms associated with a specific transaction
Hi..
Can anyone please suggest me how to know the forms associated with a specific transaction.
For Example In Finance module.
I came to know from SDN the form associated with F.64 as F140_acc_stat_01.
But i need the steps how to track the form name.
Regards..
VinodhHi,
1.We cann't find the forms associated with a specific transaction.
2.But,based on requirement we can go for the form selection.
3.Suppose in account payable and receivable , we have different forms like customer statement, Dunning and Chek form etc.
4.The functional people can find the form name in SPRO and give the details of the requirement.
5.If u have the output type or formname u can go for the TNAPR and TTXFP tables and u can search for the respect object.
6.For FI u can directly find in the SPRO, by searching it with the form name.
Regards,
If helpful reward with points(Don't forget). -
When in the TAB Racing site at a particular race I click on Form to access the form guide for that race. Instead of the form guide I get an error message " Java Script Void " This has only started recently and not as a result of anything I have done ..... HELP !!!
Delete the song from your library and re-download it from the Purchases section of the iTunes Store.
http://support.apple.com/kb/PH12491 -
I have an Ipad, I activated the time capsule with no issues. I added the airport Utility application without issue. However, I do not know how to access the hard drive with either my Windows computer or the Ipad. Does someone know how?
On windows load the airport utility .. latest correct version as possible.. there is no windows 8 but win7 works after a fashion.
Make sure the TC is using SMB compatible names.. short no spaces and pure alphanumeric.
Type the name directly into windows explorer.
\\TCname or \\TCIPaddress
If no luck turn off all the firewalls.. internal windows plus security software plus whatever other gargyoles and other rubbish AV software you have running.
Ensure windows is able to at least ping the TC by IP address and name..
Use the utility in windows to set file sharing to guest account on with full read and write access.. and set workgroup to WORKGROUP. -
Integrating Oracle Forms 11g with JavaScript - keystrokes support issues
This article
http://www.oracle.com/webfolder/technetwork/tutorials/obe/forms/11g/jsinteg/formsjsinteg/setup.htm
shows the JavasriptIntegration with Oracle Forms.
I am trying to navigate out of Oracle Forms Java Applet with separateFrame=false to access an external menu using JavaScript. I can't find a way to navigate out of Oracle Forms. My focus stays inside the currently opened form and the applet does not lose the focus.
I need to access any external UI component by shifting the focus form the Java Applet to that components using only key strokes.
Thanks for your helpVikas,
Sorry for the delay. I am still investigating this. In general, it would appear as I mentioned. If the form that contains the code specific to the event monitoring has not been run, then it cannot be executed. We are trying to get clarification on the definition of "scope" in this case. In the mean time, one alternative might be to subclass the related triggers/pu and include them in all of the forms where you want them to fire. Currently I am suspecting that scope refers to a relationship to forms currently running. For example if you have form A, B, and C running a scope of "form" might suggest that the events are only monitored if the current form includes the necessary code. However, if "application" then even if the form containing the necessary code is not the current form, the necessary code would fire anyway. Again, I am trying to get more clarification, but it is slow coming.
If this is truely an urgent issue, I encourage you to create a Service Request with Oracle Support. -
Capturing form values with javascript (not working in Safari!)
Hi
I'm working on a site and I need to be able to take the values of one form (that the user has entered) and use them to populate a second form (more details) in the appropriate input boxes. This works on all browser except Safari. It seems to me a javascript problem (as getElementById does not work properly) but I'm not entirely sure. The code I use to grab the form elements is as follows:
obj = $('formslider".$this->id."');
obj.getElementById('registerfirstname".$this->id."').value = callbackfirstname".$this->id.";
obj.getElementById('registersurname".$this->id."').value = callbacksurname".$this->id.";
obj.getElementById('registeremail_addr".$this->id."').value = callbackemail".$this->id.";
obj.getElementById('registertelephone".$this->id."').value = callbacktelephone".$this->id.";
obj.getElementById('registerrequest_type".$this->id."').value = requesttype_callback".$this->id.";
This basically takes the values of the "callback" form and places them into the appropriate input boxes of the "register" form. However it seems to lose the values when moving to the next form. Please note, I am not refreshing - I am using Ajax to change the form so new content simply replaces an existing content, not transfering to another page. I use Sessions so it shouldn't forget the values.
Can anyone help? It's quite an important thing as I need to migrate hidden form inputs too which are needed for this particular request system.
Thanks
MichaelI'm seeing this same issue in Mavericks, 10.9.2. Althought JavaScript is enabled in Safari, it just doesn't work, for any pages.
I've tried different user accounts, including a new account, on the same machine, but they all do the same thing, so it's a machine-wide issue.
I have plenty of other Mavericks machines, including my own, where it is working just fine, however, with the same settings. -
Podcasts : how to access the "Grouping" tag in the Info window ?
I upgraded yesterday to iTunes v12.1, and today I discovered that I cannot anymore access to the "Grouping" tag in the Info window (still available using ALT/OPTION in iTunes v12 and v12.0.1).
The "Genre" tag still available, but it is useless for Podcasts episodes, as ALL of them are pre-identified as "Podcast"…
Anyway, the "Grouping" tag is still present within the Podcasts files and the iTunes episodes datebase, as I can display it as a column in the "My Podcasts" pane (list of episodes) !
Does anybody know a way to still access/modify this tag field "Grouping" for Podcasts ?CLASS LCL_EVENT_RECEIVER DEFINITION DEFERRED.
CLASS LCL_EVENT_RECEIVER DEFINITION.
PUBLIC SECTION.
METHODS HANDLE_DOUBLE_CLICK
FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID.
ENDCLASS. "cl_event_receiver DEFINITION
CLASS LCL_EVENT_RECEIVER IMPLEMENTATION.
METHOD HANDLE_DOUBLE_CLICK.
PERFORM HANDLE_DOUBLE_CLICK.
ENDMETHOD.
DATA:EVENT_RECEIVER TYPE REF TO LCL_EVENT_RECEIVER.
<AT PBO>
SET HANDLER EVENT_RECEIVER->HANDLE_DOUBLE_CLICK FOR GO_GRID.
<AT PAI>.
FORM HANDLE_DOUBLE_CLIC .
FLAG = 1.
LOOP AT LT_LVCFIELDCAT INTO LS_LVCFIELDCAT.
IF LS_LVCFIELDCAT-FIELDNAME = 'ABC' AND FLAG = 1.
LS_LVCFIELDCAT-SELTEXT = <WHAT EVER U WANT>.
MODIFY LT_FIELDCAT FROM LS_FIELDCAT..
ENDIF.
CLEAR FLAG.
ENDLOOP.
ENDFORM.
NOTE: IAM PUTTING FLAG BECAUSE WHEN U GO BACK IN THE ORIGINAL SCREEN U SHOULD GET THE OLD TEXT, SO , THERE U CHECK FOR FLAG = 0.
AND UR SECOND QUESTION, PLS EXPLAIN IT CLEARLY -
How to access the form items dynamically
The issue here is that I want to acces the value in the textboxes dynamically
Here is the code ( I know its wrong )
<cfset temp = TaskEntryIDs.Split(',') />
<cfloop index="x" from="1" to="#arrayLen(temp)#">
<cfset TempControl = "Form.t"&temp[x]>
<cfif isdefined("Form.t"&temp[x])>
<cfoutput>#"Form.t"&temp[x]#</cfoutput><br/>
</cfif>
</cfloop>
I don't know the correct way to access it, I know that the textbox name start with T and the task number
I know that the textbox for the task number 74 is t74, but how can I access the value of this text box so I can insert it into to the database ?
Please help me
ThanksArray Notation:
Form["t" & temp[x]]
StuctKeyExists() is an easier function to determine dynamic form fields exist.
<cfif structKeyExists(form,"t" & temp[x])> rather then isDefined().
Maybe you are looking for
-
Here is the scenario of deletion
Hi i am asked to handle this scenario...... I have a table which stores the list of all phone numbers, owner of the phone in my database..... the front end application is java.... i was told that they (java guys) get the a csv file with the list of a
-
FF WON'T OPEN. SAYS IT'S "NOT SUPPORTED ON THIS SYSTEM" USED TO WORK JUST FINE.
Icon has disappeared from dock, notice says "Firefox is not supported on this system", icon in Applications folder now has a circle and slant line through it. What happened? I tried to re-install it and got the same result. Am running OS 10.4.11
-
Disable the mouse pointer icon!
As in the title, is there a way to disable the mouse pointer icon, ie when you rollover the button it changes to the "finger". I dont want to see the "finger" I just want it to remain as the "arrow"
-
My '07 Intel Macbook Pro will not charge.
New battery has been put in two months ago and not heavily used. Have tried other chargers but Mac will not power up/turn on. Any ideas? Ta
-
When I install any theme, the homepage (more specifically Black Google) will not load as homepage. How can I fix this?