How do I copy a populated field, say a "company" name from one web page to another? - html

I want to copy (populated) data, say a "company" name from a form, to another form, and/or web page. This (populated) data field changes, based on what the client enters, however, the resulting data is always a "company".
Is there code I can paste into my HTML document to do this?
To better clarify what I want to do, please see as follows:
("To: ____")
This is on the top half of my web page in a word document contained in a form.
("Bandera") is the company name.
This is on the bottom half of my page in a word document contained in another form.
All I want to do is copy the "company" name (in this case Bandera) to the "To:___" on that form.
I only mentioned the fact that the company name "Bandera" changes, in case this has any affect on the issue.
I am not a programmer and do not know any languages, so I am looking for the easiest way (a code I can paste into my HTML document) to accomplish this.
Thank you,
Michael

This doesn't look like a problem with a simple cut and paste solution. Since you haven't specified what technologies you're using, i'll keep it generic. Two options that I see are:
Have the user submit the form, take the entered value on the server side and set it as a value/default in the resulting (your other) form that you return.
If you're just looking to populate another form on the same page, you can hook the onblur/onchange event of the input control with javascript and populate the value of a second form using something like the dom/javascript function GetElementById or GetElementByName.
Hope this helps point you in a useful direction.

It sounds like you are referring to a data-bound fields?
I am assuming further that the Company is populated from a database as an ID/Name hash/datatable.
If you are using ASP.Net, there a few options of which some are: storing your key for the data-bound field in Session, moving it across to another page using inline variables, or storing the selected Id against a user details table, and retrieving the ID on the other web-page.

Related

Access Form - how do I only display fields and cell values if the cell has data?

Could someone please help me with configuring my access database? I would like to use a combo-box at the top of the form where the user selects from the available work forms (Column 1 in Table) and then it displays who is involved in the form. Currently it displays every field and to reduce to the information displayed I would like it to only display information if the cell has a value in it.
Am I using the wrong tool? Should I be using a Report instead? How's my table data, too much?
Many Thanks
My current form
My wanted result
The way I normally hide empty fields is to change the label for a field to a control and set the control source to the following:
=IIf([FieldName]<>'', "My label:", Null)
Then I set the CanShrink property on both the "label" and the field to Yes.
Finally I make sure the section it's in (typically the detail but you may have reason to use something other) also has CanShrink set to Yes.
When you stack the controls on top of each other in this manner you should get the result as you posted.
Note: this only works for reports or if you print the results of a form. If you do not intend to allow entry of data into the form it would be better served as a report.

CakePHP - refresh element/view cell using ajax

I'm trying to build a way to update a user profile one question at a time.
Essentially I want a div on my page that displays a form that lets the user submit the most important information, say firstname. When that has been filled out (success on the form) I want to refresh that div and show the second most important form, for say lastname, or if that is already filled in then birthday and so on.
Much like linkedin prompts you to add one more piece to your profile.
How would you do it?
My first thought was to use elements. But I need to fetch existing profile data to populate the form and how would the element get that data, abusing requestAction is not an option.
So I guess I in that case need to call a controller action that determines which element should be rendered, renders it to a variable and submits that (response->body) in json to the js that updates the page. Seems a bit .. unclean but should work.
Then we have view cells. They seem ideal for the task until I want to call them via ajax. That is not possible right?
So how would you go about to build something like that?
A form that needs to have the ability to be prepopulated with data if there is any and then refreshed automagically to display the form for the next piece of info needed.
View cells can't really be used in AJAX requests. This is not what they thought for.
The best thing you could do, if you want to keep the cell, is to make sure you followed SoC properly and put all your business logic into the model layer.
Now have a separate controller and action that is reachable from the outside throught a request (a cell is not) and return the data as JSON from there using the same code.
You could try to instantiate the cell in the controller action as well and send it's output. But honestly, I think that's a pretty fugly way of doing it.

MS Access Creating Attribute Tagging Form

I wanted to ask whether or not MS Access can handle an attribute tagging form. Note, "attribute tagging form" was a term I innovated to describe what I had in mind. If you would happen to know the correct term, please let me know.
My Current Method:
On left pane, I have the PDF file in question with file preview. On the right, a Microsoft excel file with the title, file name and other attributes.
The task:
In the left, same PDF. On the right, I need to scroll to the right some distance to mark "Peanuts" and "Soybeans" with "1". Flagging the PDF pertinent to peanuts and soybeans.
The Question:
What I would like to do is create a form in access that would allow me to type out one of the attributes instead of having to scroll back and forth and marking it with a 1. The risk for an error would be too great once there are several dozens attributes to flag.
What I had in mind would be much like stackoverflow's tag function:
Where I can start typing an attribute, and if there is already one existing, it will autocomplete and I can move onto the next one. This will then reflect onto a database (or spreadsheet) with a 1 in the correct column and row.
Side note:
I've done some research on my own into Access' tagging function, but it would appear that it would not work to what I have in mind.
[Resource 1][4]
[Resource 2][5]
[Resource 3][6]
[Resource 4][7]
I think the term you're looking for is "search as you type". You'll find examples here on SO and elsewhere.
Basically, a text box or combobox has a On Dirty event procedure that narrows down a result list as you type the first (or any matching) letters.
In your case, once you've selected a tag, you'd add it to a list, clear the text box, so you can continue with the next tag.

Hold data for list to add later?

So no SQL tables or anything here. Basically, I have 3 pages that have 6 items each. Each item consists of an image and then some text and also a smaller image than changes from a check to an "x" depending on if user selects or not. So if the image is checked, the user is adding that to a list which would display on a fourth page. This data needs to persist through just a session and if the session times out, then it resets. If the list is complete and on that fourth page the user choices to email or share list via social sharing, then the data would be gone after that action. What I am trying to figure out is the best way to approach and implement this with minimal time and effort as it has to go out quickly. Can any of you explain and maybe point to some links with info on the best way to achieve?
This is being done in asp.net web forms with html, css, and javascript.
Much appreciated!
You can use ViewBag() (for view in razor) or ViewData[] (for page in .net) to hold data for one web page.when you want it to other page. You can pass it to other page.
check this out
ViewBag, ViewData and TempData

hyperlink field in table doesnt work

I have an Access table that has a hyperlink field, with the records being a website link, to look up the UPS Worldship shipment tracking#. My problem is that even though the text has blue colored font, the link doesn’t launch and open the web browser when I click on the field.
originally the hyperlink did work, when I created the table and changed the field properties from “text” to “hyperlink”, but once I ran a delete query and an append query (in order to refresh the data), the link no longer functioned, even though the field has hyperlink properties.
Here is an example of my hyperlink record that I want the browser to launch: http://wwwapps.ups.com/WebTracking/processInputRequest?sort_by=status&tracknums_displayed=1&TypeOfInquiryNumber=T&loc=en_us&InquiryNumber1=1Z1467826772975386&track.x=0&track.y=0
Please advise what I need to do in order to make the hyperlink work, so the user doesn’t have to manually copy and paste the link into a web browser.
Thank you very much in advance
Nathaniel, Access 2003
I don't understand what you mean. I need to create an Access app that would be used throughout the day in order to track UPS packages. Ideally the table would provide a link, so that the user doesnt have to manually copy and paste the tracking number into the UPS website. Please advise if this is feasible without VBA.
I do not like hyperlink fields, they are difficult to edit and somewhat confusing for the user. I prefer to use a click event with FollowHyperlink. However, if you must use hyperlink fields, they have to have this format to work:
Descriptive text#link#
So
Stackoverflow#http://stackoverflow.com#
http://stackoverflow.com#http://stackoverflow.com#
Email#mailto:mail#example.com#
I imagine you have lost the link - that is, the bit between the hash signs.
Try going back to the table with the record and change the data type to short text. Close and reopen the table and switch the data type back to hyperlink. If the text is a valid webpage link it should work without any extra coding.
Good luck!