How can I pass '#' as part of a parameter in html? - html

I have an html form that I desire to be pre-populated with variables that are passed as parameters within the URL. Basically imagine that I am typing this string directly into the browser.
When I pass a variable that contains '#' however, it is read as syntax different from the string and the full variable is not copied into the form.
Example: https://form.domain.com/formname??variable1=www.variabledomain.com/#/h7Y6F53/
When I enter this into my browser, variable1 pre-populates only with "www.variabledomain.com/". I'd like it to pre-populate with "www.variabledomain.com/#/h7Y6F53/".
What can I do differently?
Cheers

Related

ColdFusion convert hidden form variables to a structure

The app I am working on has hidden input variables set on initial load of the page. The variables need to be accessed across all pages. The reason for not converting these to session variables is the user can open another browser with different parameters and passing those value as hidden inputs make it work without any issue. What is the best possible alternative so as to get rid of these hidden inputs..I tried converting all variables into a Structure, but again the structure needs to be posted as part of form submission to make it available to subsequent pages.Another disadvantage of this app is use of frames.I don't have any code to post.
It sounds as if you want different browsers instances which are associated with the same web session to maintain their own distinct sets of data. Doing this by passing form or url variables around seems like a bad idea.
One approach that you could use would be, onSessionStart (or as required), create a structure in the users session to hold instances of the data. For example
session.data = {
someRandomKey: {
valueA: 42,
valueB: "Porridge"
}
}
Then just pass someRandomKey as a hidden form field or querystring parameter. Now, when they submit the form to update variables you use the id from the hidden form field to find the appropriate structure from session.data.
When the user needs a new instance of this form, give them some way, like a link or button, that creates a new unique key, inserts a struct in session.data with this key and populates it with whatever defaults are needed then loads the form passing along the new id as a hidden form field or querystring param again.

Sourcing a value from a list box and passing it onto an object on a form

I would like to take a numerical value found within a list box i have on a form and bring it into a text box on the form itself. I would like to to this to then use that value as a unique ID number to link to one of the sub forms found on the form. Is it possible?
I have something like this on one of my forms, I would suggest setting it to a global variable and then using that variable as a control Source.
in VBA create a module and call it something.
Public Function Something() As Variant
'Finds the Current Selected value from Form Element
Something = Forms("MainMenu").texbox.Column(1) ' 0 is the First Column
End Function
This is what will store your variable. Then you need to call it from your form. If your wanting to pass it to another form i am assuming you have a button or something that calls the other form to open. On the same trigger before any of your other code is ran you need to put:
Call Something
When you call it, it will set what ever value is in your textbox to that variable.
Once you have this variable stored you would simply put in the control source of the textbox on your other form:
=Something()
Then when ever your other form is activated it will display what ever ID was stored in the variable.
Just remember if you direct your user away from your form to re-set the variable to nothing.

SSRS Pass Parameter via URL

I have the following report URL:
/Reports/Pages/Report.aspx?ItemPath=%2fcMIS%2fgradebookProfileView
I'm trying to pass the parameter TG via the URL so it looks like so:
/Reports/Pages/Report.aspx?ItemPath=%2fcMIS%2fgradebookProfileView&TG=10BEE%20C
However this doesn't work, how can I make this work so that it automatically enters 10BEE C into the parameter textbox.
You can't use the /Reports/ front end to pass parameters, you have to use the web services end point to pass the parameter (normally at /ReportServer/). It should still present the Report Viewer interface just like it does on the Reports url.
But your URL would become:
/ReportServer/Pages/ReportViewer.aspx?%2fcMIS%2fgradebookProfileView&rs:Command=Render&TG=10BEE+C
Two things of note. The URL parameter name must match the report parameter name, not the prompt. Also, spaces are encoded to + instead of %20.

HTML form submission with special characters

I am trying to submit a form field whose value is Transaction ID - sample . When the date gets submitted the value is Transaction ID ? sample
How do I get rid of the ?
I used HTML special codes for dash/long dash/short dash but still value gets submitted as ?
Please help
The only way to ensure that all input characters get sent correctly is to use UTF-8 character encoding for the form data. This happens automatically if the page containing the form is UTF-8 encoded (and declared to be that); otherwise, use the parameter accept-charset=utf-8 in the form data.
Naturally, you form handler must then be prepared to handling UTF-8 encoded data.

Umbraco razor template - Get Formatted Date From Field specified in parameter

I'm trying to return a formatted date from a razor template in umbraco. I'm not sure how to get a value from a field defined in a parameter though.
Here is the code I'm playing with. The field I'm passing in is called "articleDate". I'm getting the parameter value output, however when I try to get the value of the field using the parameter name it returns nothing. If I ask for the value by the field name itself, that works. How can I create a generic macro like this?
#{var param = #Parameter.dateField;}
Field Name: #param
<br/>
Field Value: #Model.param
<br/>
Field Value: #Model.articleDate
I tried using #Model.GetDynamicMember(..) as well, but that just throws an exception.
Field Value: #Model.GetDynamicMember("articleDate");​
Error loading Razor Script getDate.cshtml
Cannot invoke a non-delegate type
Can someone point me in the right direction? I'm just trying to create a simple macro I can use to format dates across my page.
Is it possible to pass the value of my date directly into the razor macro? This is how I'm currently calling it:
<umbraco:Macro ID="Macro1" Alias="getDate" dateField="articleDate" runat="server"></umbraco:Macro>
If you call your Macro like you wrote:
<umbraco:Macro ID="Macro1" Alias="getDate" dateField="articleDate" runat="server"></umbraco:Macro>
You're actually passing the name of the field "articleDate". In the macro, you then may get the value of the Model's articleDate property by using:
Field Value: #Model.getProperty(Parameter.dateField).Value
Instead of macro's I also recommend using helpers or - for more complex scripts - RenderPage. A nice writeup can be found here:
http://joeriks.wordpress.com/2011/03/11/better-structure-for-your-razor-scripts-with-renderpage-in-umbraco/
Example:
#helper GetDate(dynamic dateField)
{
#dateField.ToString("[yourFormat]")
}
You may pass parameters to scripts rendered with RenderPage by using the Page object:
<umbraco:macro language="razor" runat="server">
#{
Page.dateField=Model.articleDate;
}
#RenderPage("~/macroscripts/getdate.cshtml")
</umbraco:macro>
getdate.cshtml:
#Page.datefield.ToString("[yourFormat]")