I've been using some code to verify form data quite happily, but i've
recently changed the way my form is structured, and I can't get it to work
now.
Originally :
The form is called "form1", and I have selects called "PORTA", "PORTB" ...
etc...
I then had javascript that accessed these selects as below, and it worked
fine.
ind = document.form1.PORTD.selectedIndex;
val = document.form1.PORTD.options[ind].value;
dev = document.form1.PORTD.options[ind].text;
My form is now autogenerated, and form data is stored to file, so I now use
an associative array for thte form elements (so that I can loop through them
easily), The form elements names are now :
McuCfg[PORTA], McuCfg{PORTB} and so on
Now, I modified the javascript so that it now uses the McuCfg[] associative
array :
ind = document.form1.McuCfg[PORTD].selectedIndex;
val = document.form1.McuCfg[PORTD].options[ind].value;
dev = document.form1.McuCfg[PORTD].options[ind].text;
When the script runs, I get the error
"document.form1.McuCfg.PORTD is null or not an object"
I have used the same notation that i know works for the "options" array
although that's not an associative array.
I am working on a PHP-script and need javascript to set the value of a hidden field in a form. This field happens to be an entry in an array data[3] according to my example. How can I do this?
Below is listet two PHP-pages: one that doesn't work (to my dismay), and another that does work, but do not use an array entry in the hidden field. Code:
can anybody help me in writing a javascript function which opens a popup window with the target URL when the link "POST Request" is clicked..
Points to note:
The HTML DOESNT and SHOULDNT HAVE A FORM TAG. The URL data should be sent as POST and not GET..i.e the search parameters should not be showin in the address bar when the page is opened.
I want to send form data to given email id, I'm using mailto:ur@mail.com, but it doesn't working it dirsctly goes to localSystem A/C i.e outlook.. Code:
Does anyone know where I can find an ASP server side script written in JavaScript to parse text fields from a form method='POST' using enctype='multipart/form-data'? I'd also like it to parse the filename.
I found a great ASP VBScript for uploading files, but the rest of my Web site is coded in ASP using JavaScript and I can't figure out a way to immediately pass the text fields already parsed from server side VBScript to server side JavaScript.
My ASP code looks like this:
<script language="JavaScript" runat="server"> //I would like to add JavaScript to parse the text field and filename of file1 here. </script> <!--The 3rd party document below parses all fields from the message content and uploads any file fields it encounters.---> <!--#include file="aspinclude/upload.asp"--> <script language="JavaScript" runat="server"> //Add record here (title1, filename from file1). </script>
it seems to be a problem if I need to access data() of the elements from another window, like for example $(anyElement,window.opener.document).data() which returns null when in fact there is some data actually stored. I heard that data is stored in the $.cache, which is window-related, so that's understandable, but how can I work around that?
Certain plugins that use $.data no longer work correctly because of that. E.g., I can't use linkselectmethods on linkselects located in the window.opener.document. Again, is there any workaround?
I am working on a project using HTML and javascript to allow the user to choose a vehicle from a drop down menu, then load a new page showing some information about this vehicle. The information is stored in an Excel file. I posted regarding this issue a while back and got an excellent response from Old Pedant about using ActiveX - which has thus far worked perfectly. My initial condition was that I would only be using IE7+. However, my next idea was to be able to use it on an IPad (which I unfortunately do not own yet, making any kind of testing difficult) which I am fairly certain ActiveX won't work on. So, I was looking for any other method which would be similar.
Important note: this will not use the internet at all, all of these files will be available locally. There is a lot of material on running queries to servers, but I didn't think that would really apply here. It seems pretty clear that JS has difficulty accessing files client side (which I understand why completely), but I was hoping to find something that worked for the gray zone I'm currently working in since I'm not using servers at all.
I know that this is not really the intended use of HTML/JS, but I was hoping that by writing it as an HTML file, it'd be accessible to anyone with a browser. Some of my target computers have odd limitations (such as not being to download .exe files).The code I based my original off of is shown below:
<script type="text/javascript"> var conn = new ActiveXObject("ADODB.Connection") conn.Open ( 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:fullpath oMyExcel.xls;Extended Properties="Excel 8.0;HDR=Yes;IMEX=1";)'; var sql = "SELECT * FROM [nameOfSheet$]"; var rs = conn.execute( sql )
I have 3 Jquery tabs on the form. Each tab contain same HTML Tables, I want to access the data in a Cell of a table in an active tab on the button click
in normal Case I use
var x=document.getElementById("searchResultTable").rows[10].cells; referenceNo=x[2].innerHTML;// get the value in the Cell alert( "x[2].innerHTML);
if i use this Code i get only the First Table data .All the Tabs Contains Same Table with Same Id and Name
I have a frame in which there are 2 IFrames., both being loaded from the same domain. One IFrame is loaded from http://test1.xyz.com and the other IFrame is loaded from https://test1.xyz.com/test
I am getting an error while accessing data in the HTTP IFRAME from the HTTPS IFRAME.
Is it possible at all to access the data in the other IFrame, when the protocol is different?
When retrieving JSON data I'm able to access individual elements using the $.each() function and iterate over them. However, how would I access just one element by its location and not by name? (i.e. data(0) not data.ID).
I have this problem in xsl wherein i want to access a variable in javascript and use it my xsl. How would i access or use a javscript variable in my xsl file?
I have seen web pages sites, when you drop down a list box, it seems to go back to the server to retrieve some data without reloading the whole page (e.g. select make of car and it retrieves a list of models from the server to populate another list box).
So I'm currently working on a ASP.NET Webforms site and I've run in to a small problem. On my .cs file I have the following Webmethod
[WebMethod] public static string IsJobEditable(int jobid){ try{ string isEditable = "false"; JobsBLL jbl = new JobsBLL(); int jobStatusId = jbl.GetJobStatusId(jobid); //If the jobs is either waiting or being edited it is okay to edit it if(jobStatusId == Convert.ToInt32(ConstantsUtil.JobStatus.Waiting) || jobStatusId == Convert.ToInt32(ConstantsUtil.JobStatus.Edit)){ isEditable = "true"; }return isEditable; }catch (Exception ex){ throw ex; }}
This function in this case will ALWAYS return TRUE as a string. On Aspx page I have the following $(function () { $.ajax({ type: "POST", url: "Coordination.aspx/IsJobEditable", data: "{jobid:" + jobid + "}", contentType: "application/json; charset=utf-8", dataType: "text", success: function (result) { alert(result);
//This is written out in the alert {"d":"true"} I want this in a variable as a string so I can do a check on it before I do some other actions. The format is not a String so I cannot split on it to retrieve the "true" part. }, error: function (err, result) { alert(err); } });});
As you can see in the comments the value I get back in the Callback method is in to me a weird format. The type is unknown and I need this value to be able to proceed with my entire method surrounding the small portion of the Javascript. Where to access the result variable / data as a var or anything else that will let me put it into a var (as a string).
All are the same except the value is set differently for each one. The reason for the [] is so I can access the checkbox values as an array on the processing page (when clicking 'Submit');
However, I want my Javascript code to examine these objects first. My onclick event handler function (below) is called (I get the 'hi there' popup), but it does nothing afterward (i.e., neither 'checkbox' alert appears, and the handler, strangely, seems to return 'true').
I suppose my problem is that I am not specifying the checkbox array properly. I tried several variations, but I've been working on this problem alone for several hours and am getting nowhere. Code:
I have a form. Upon submit, the data is sent to the server. Under certain conditions, the form is replaced via ajax with a set of radio buttons that offer the user a a choice.I need to access the radio buttons before I submit the form again.Normally I could just access the buttons with getelementbyid but it is not available, presumably because they were generated via ajax.I could submit the form just to access the radio buttons and then submit it again, but I'd like to avoid that.
The scenario is of two different web servers. The parent frame (html page orginates from server 1) has script like function x1() { ..... alert('parent invoked'); .... }
Inside child frame (html orginates from server 2) the html refers to parent script like { ..... parent.x1(); .... }
It throws Microsoft Jscript runtime error: permission denied. I am using IE based on WinCE 4.2 version platform.