Get Value from thick box control - asp.net

I have hidden field on thick box, when I close thick I need to get the value of my hidden field, when close thick box this method calls
function tb_remove(parent_func_callback) {
parent.document.getElementById('hdf').value// I need value of hidden field here
please tell me how can I get hidden field value that is on thick box?
e.g I have page abc, I click on heyperlink from page abc, then page xyz open as thick box, on xyz thickbox I have hidden field name hdf, now I click on close button of thick box, tb_remove is called that's in thickbox.js file, I need to get the value of hdf here in js file to use in abc page.
Thanks

Well if I understand the question correctly, 'hdf' is the ID of the hidden field, so this will get you the value then... If I have misunderstood let me know.
I assume by thick box you mean you want to get a control inside an iframe or something similiar... here's how.
var hdfVal = $('#myIFrameID').contents().find('#hdf').val();
Or simply, just need to get a value of a control by ID...
var hdfVal = $('#hdf').val();

Related

OnClick on ticketid need to open a details of ticket using birt report

I had a requirement to create a report based on individual user whom having SR waiting for approval, On click on Ticket id the URL's should redirect to SR detailed page where he can check request approve or disapprove.
using hyper link in birt properties unable to pass the ticketid by using below url's
http://google.com/maximo/ui/maximo.jsp?event=loadapp&value=asset&additionaleventvalue=Ticketid
Could you anybody help in this regards.
If the cell you made clickable contains the ticketId, go to Properties -> Hyperlink -> Edit...
Select hyperlink type URI, and click the dropdown to the right of 'Location' to go to the Javascript window.
If you're going to use it more than once, I would make the static part of your hyperlink a variable. Then add the ticketId by clicking "column bindings" in the left-lower column in the JavaScript window and selecting the appropriate cells in the middle and right columns. You'd get something like
vars["staticPartOfHyperlink"] + row[TICKETID]
If you'd rather not use a variable, you can hard-code the static part (don't do this, it's ugly and asking for trouble):
"http://google.com/maximo/ui/maximo.jsp?event=loadapp&value=asset&additionaleventvalue=" + row[TICKETID]

getElementById("id").value

So I have an input box in a custom pop up div that is in a hidden div on the page until the user clicks on something activating the pop up box. When the user clicks we get the html of the hidden div and add it to our popup box div which is located in the master page(MVC.)
<input type="text" id="from" name="from" value="MM/DD/YYYY" style="width: 90px;" />
If I change this field and run a script on the submission of the form
var fromDate = document.getElementById("from").value;
I still get the MM/DD/YYYY Default value and not the value I entered. Even more oddly I did an onchange event on the from field and I still get MM/DD/YYYY.
Any help would be greatly appreciated, I have no idea whats going on. Could it be that it's still fetching the value from the hidden div?
Don't you mean
document.getElementById("from").value
instead of
document.getElementById("to").value
I hope your code should have been like
var fromDate = document.getElementById("from").value;
I was filling this temporary element with a hidden div on the page. Because of this I was not returning the value in the temporary pop up but, instead, the value in the hidden div. I needed to rearrange to get it to work.

Why can't I set a value on this form field in wordpress admin?

I'm trying to get the value of a form field on submit using jQuery. However when I try to alert it, it's shows up as undefined, with text in.
var title=jQuery('#fields[field_4f52672267672]').val();
alert(title);
It's got a funny ID though because I'm using a form plugin to create my form. When I inspect the element it simply shows the value attribute with no value beside it, even when it contains text. Can anyone explain what is going on please?
I've attached a screenshot of the field inspected with chrome's inspector panel.
var title=jQuery('#fields\\[field_4f52672267672\\]').val();
Into selectors you have to escape with 2 backslashes.

anchor target blank - how to always open in same popup window

I have a number of anchors in a page. I want that when the user clicks on an anchor it would open a blank window. I have used target='_blank' and that works correctly. However, I want that if the user clicks on another link in the original page, I would like that it uses the same popup that was opened for the first window. What I do not want is that the user ends up with like 10 popups as this would be a bit messy for the user.
Is this achievable please?
Any assistance would be greately appreciated.
target is deprecated since HTML 4.01, you can however use JS like this:
test
<script>
var clicky = document.getElementById("clicky");
clicky.onclick = function(){
window.open(clicky.href, "test");
return false;
}​
</script>
in the window.open, the first attribute is the URL the link should go to, the second is the name of the window, clicking any link setup like this will open in the same window.
there's better and easier ways to do this to multiple elements with jquery etc. but it all hinges on the window.open.
Instead of using _blank (which is a special value for a new window), use a name - any name would do.
target="mySpecialPopup"
When naming a window this way, every time you call it by name it uses the same instance.
Just name your target.
target='mywindow'
This should open a blank window the first click and repopulate it when other target='mywindow' links are clicked.

Textfield value empty when I fill it with javascript

I am using modalpopup to enter some value in a textfield. After the value is selected in the modalpopup view, the modalpopup is closed and the value takes the appropriate value. Even if the value is displayed in the textfield, the textfield1.text returns an empty string. When I see the source code (html), I see that even the textfield isn't displaying anything; it hasn't really had this value input, because the appropriate html input field hasn't got a value yet.
This is the code I use to fill this textfield:
function CloseRequestModal(s)
{
document.getElementById('<%=txtRequest.ClientID%>').value = s;
var mpu = $find('<%=ModalPopupExtender3.ClientID%>');
mpu.hide();
}
Please help.
I would need to see source HTML cause it looks like you have template language mixed into your javascript but perhaps instead of "textfield1.text" you use "textfield1.value"?
Additionally, you would need to view "generated" source (with a browser plugin) or inspect the node with web inspector on safari/chrome or firebug on firefox in order to see the change that you made with javascript.
i fixed this problem in an alternate way.
even if the value is there (in the textfield), none of the events is fired, to let know the browser / compilator that the value really exists.
so i decided, despite editing the value of the textfield, i store this value in the session too. in this case, the value is displayed for user needed in the interface, and on the other hand i use the value that i stored in the session.

Resources