.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Passing hidden field ASP.net to javascript

Posted By:      Posted Date: September 17, 2010    Points: 0   Category :ASP.Net
Hi!   I have in my project an button that when is press need to verify if the aplication has been save. If the app no save, then popup a message (confirm box) to ask user yes or no to continue.   Hi have in my asp code a hidden field that gives me if the app is saved ou not, and I have this javascript function that I atach to my button onclientclick function.  <asp:HiddenField ID="HIdCab" runat="server" />    <asp:Button ID="BtnRetomar" runat="server" CausesValidation="False" CssClass="botao" Text="Retornar" Width="85px" onclientclick="" />   <script type="text/javascript" language="javascript">function MyRetornar(){    var myId = document.getElementById("<%=HIdCab.ClientID%>");                if (myId==null)    {               return confirm('Quer retornar SEM GRAVAR a aplicação actual?');   }    else    {        return true;     }}                   <

View Complete Post

More Related Resource Links

Javascript price update ...hidden field ... asap

Hello Experts http://store.apple.com/us/configure/MC374LL/A?mco=MTc0Njg1ODA Like in this link i created a javascript function  === id , lenght , width , dept , capacity ,price ..<script type="text/javascript">function getproductdetail (id,len,wid,dep,cap,thick,prc)     {          document.getElementById('row1')=prc   }          </script>the same function is called at a new place where i pass only price .. i have to check if there is a price is present in 'row1' i have to add new prc to present one .. =================== thing is where i will retain the old value present .. How to check whether value is prsent in row1 or not ..... if i will choose hidden field where to use and how to check value for that ... Thanks

Collect Feedback workflow hidden field


Hello all,

I am using the out of box Collect Feedback workflow.  It works well for most part.  However I would like to get reviewer's feedback to be shown on a Dashboard.  Is there a way to expose that information in a Data View?  I couldn't figure out which data field stores the feedback information.


Mission Impossible? Use Javascript to Disable a Multi-Line Rich Text Field


Hey Community,

Here's a tough one that I have struggled with and so far have not been able to find an answer for - how do you use Javascript to disable a multi-line rich text field.  I have customized a SP Edit form by adding a CEWP.  In the CEWP I have added the Javascript below (only a partial code sample provided) to disable several fields in the form.  The code works fine for single line text fields but it does not work for multi-line rich text fields.  Any suggestions?

<script language="javascript">
//This runs the function when the form first loads

//This locks the fields the users should not modify
function lockFields()
  var theInputTFTitle = getTagFromIdentifierAndTitle("Input","TextField","Title");
  theInputTFTitle.readOnly = true;
  theInputTFTitle.style.color = 'gray';
  //alert(" Value: " + theInputTFTitle.value);//for testing

   var theInputDDLReplyStatus = getTagFromIdentifierAndTitle("select","DropDownChoice","Reply Status");
  theInputDDLReplyStatus.disabled = true;
  //alert(" Value: " + theInputDDLReplyStatus.value);//for testing

  var theInpu

Passing value from asp to javascript function


Here is the problem 

private void Page_Load(object sender, System.EventArgs e)

private void Page_Load(object sender, System.EventArgs e)




                                      int flag = 1;

                                       btn_ModifyApprove.Attributes.Add("onClick", "return ValidateModifyApproval('" + Flag + "');

I need help with the syntax for passing a record field value from SSRS to an asp page

I have tried several variations without success.  Here is where I am now.  The goal is from inside Report Manager report, link to an asp page with a filed value. This is from the expression line of the Jump to URL entry. Also I am trying to open a new page http://www.whereever.com/CSSurvey01.asp?RecordID=" & Fields!respid.Value            

Hidden field not available in XSL

Hi folks, I have a Custom List that uses a ContentType which defines a column as Hidden (will not appear in forms). When I create a DVWP, this column is not available - i.e. <xsl:value-of select"@MyColumn"/> gives a blank value. Changing the column to "Optional" fixes this problem, but then the field appears in the normal edit / display forms. The column's value is set programatically by a web-part. Is there a setting I have missed to allow a field to be viewed using a DVWP but not in the standard edit / display forms? or any other reason why the value would not be showing up in the DVWP when the column is set to Hidden?? Thanks, Alex

Can I update Project Field value via some javascript?

Hi there, I've a webpart that's designed to update some project field value, this webpart is  located on a Project Details Pages. On this project details page, there is another MS Build-in webpart call Project Field webpart. Now when I clicked the Save ribbon button, the project field webpart will raise some client calls, at the same time my custom webpart will raise a post-back(update value via PSI) call which will kill the client calls..So is it possible for me update the project filed value via some javascript? so I'll no longer raise a postback. Or is it possible for me to capture the client calls event for MS webpart, then I can fired my own PSI code? Thank you,   Regards, Joe

Custom field type - set value doesn't work when field is hidden

Hi, I have a simple custom field type which gets a value from the Property Bag and sets that value to a label. This works fine as long as the field is set to Optional (the field is a site column and is part of a site content type), but if I set it to Hidden, the value doesn't get set. public override void UpdateFieldValueInItem()         {             this.EnsureChildControls();               if (this.ControlMode == SPControlMode.New)             {                 this.Value = GetChosenConsole();             }         }   Does anyone know why this is and what I need to do in order for it to work even though it's hidden? Thanks!

Hidden field and JS

HiI have a HiddenField in one page. So now i want to use the same HiddenField value in another page in the JavaScript(second page JS)How should i get the value into another page.Thanks

Passing an array to Javascript function, and SetTimeout

Hi, I have a js function that takes an array (of strings) as a parameter. I read some data from DB and create the a parameter and pass it to js function but it only sees the first entry. Here is the sample ( i cut out unnecessary stuff):var singletext = new array();function ns6scroll(singletext) { setTimeout("ns6scroll(" + singletext + ")", spause); } In code behind: string[] saAlerts = new string[lsAlerts.Count]; int i = 0; foreach (DMSAlertDO oAlert in lsAlerts) { StringBuilder sbAlert = new StringBuilder(); sbAlert.Append("'<nobr align=\"center\">"); if (oAlert.NavigateUrl != string.Empty) sbAlert.Append("<a target=\"_blank\" class=\"scroller\" href=\"" + oAlert.NavigateUrl + "\">" + oAlert.AlertText + "</a></nobr>'"); else sbAlert.AppendFormat("{0}</nobr>'", oAlert.AlertText); saAlerts[i++] = sbAlert.ToString(); } if (!ClientScript.IsStartupScriptRegistered("StartScroller")) { StringBuilder sbScript = new StringBuilder(); sbScript.AppendFormat("<scr

javascript for field validation on a textbox...

I'm looking at doing the validation for the email in javascript since we have asp.net 1.1. I can get it to just alert fine, but once I add the return validation it doesn't fire. Me.ImageButton2.Attributes.Add("onclick", "return validation(this);") <script language="JavaScript"> <!-- function validation () { var test=""; test = document.ticketForm.emailAddress.value; if (test == "xyz") { alert(test); return false; // validation failed } --> </script>

Pass parameter to Hidden Field in SSRS Report

Hi, I have Two Columns in a Table Say As Table1 Column1 = Text Column2= id My SSrs Report has two parameter values as Column1 and Column2. Column2 should be hidden SELECT DISTINCT COlumn1 FROM Table1. i have passed this query dataset to Column1 parameter. Now My requirement is that, when ever column1 drop is selected. the hidden field column2 should fecth the corresponding ID. this column2 has Storeprocedure which will Display the Output when View Report button is clicked Thanks, Saraswathy

passing repeater container.dataitem to javascript function

I am collecting user roles into a single dimension string array. I have a repeater that its source set to that array. The repeater template includes list of checkboxes for the values in the array.The checkbox text is set to: Text='<%# Container.DataItem %>'All is good till this point.But I am trying to call a javascript function triggered by clickign a checkbox and pass it the container.dataitem, but the javascript doesn't seem to be reading the value and either complain about string not being in correct format or that treats the container.dataitem as a liter. This is the trial that didn't work (I tried many different things too):DetermineVal(<%# DataBinder.Eval(Container.DataItem) %>);determineval is my javascript functionCan I do that with a single dimension array?thank you in advance

Set the DateTime field using javascript

Hi everyone, I need Help in implementing a solution. I have 2 fields: Resolution Date (DateTime) and Severity (Dropdown) and I need depending on the choise in dropdown (0-3) set different dates into the DateTime field. The difficult part is that I can't realize how is to SET the date there %) Here is my code: var ExpDateResolved = $("input[title=Expected Resolution Date]").first(); $("select[title=Severity]").first().change(function(){ ExpDateResolved.val(''); var chbReqSevDom = $(this).get(0); if (chbReqSevDom.selectedIndex == 0)  //first value in dropdown selected { var currentDate = new Date(); DateResolved.val(zeroPad(currentDate.getDate(),2) + '.' + zeroPad((currentDate.getMonth()+1),2) + '.' + currentDate.getFullYear()); } } P.S. I've tried to set a date into a Text field and it works.

Setting a session variable OR passing along information in Javascript

Hello, Form1 needs to send information to Form 2. Form2  opens in it's own window and is sized smaller. I need to send information to Form2 in order to set parameters in the query in Form2. At first I was just going to use an asp button control and load up some session variables, then I remembered that in order to have the next screen (Form2) open in its own window and be able to size it, I had to use an input type="Button" and use Javascript to open the new window like this:<script type="text/javascript"> function open_win() { window.open("/Accounts/Form2.aspx","_blank","toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width=1000, height=500"); } </script> But by doing this, I don't know how to pass the information along I need for Form2. How can I pass variable information to Form2?  The data comes from two textboxes on Form1: txtStartDate and txtEndDate. Thank you. 

Make a list field ediable by a group of users or hidden to everyone else.


I understand how to hide a field, but this hides it for everyone. My team want to hide it for the users and show it for our team. The field we want hidden from other users are Assigned to, Due Date, and Due Date, but we want our team to be able to edit these fields; not the other users. Is it any way to do this? Thanks for the help.



How do I posting session information to server through the hidden field ?


I have the following in my code (Login.aspx page)


 <script language="javascript" type="text/javascript">


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend