Why cant I add a URL as a prefilled Wufoo field entry? - html

I am trying to write some code that will put the current tabs URL into a wufoo form as a default value in the form hash. The code works fine but the wufoo form doesn't want to cooperate. instead of filling the correct URL (Say https://wufoo.com for example) it drops one of the / characters. This also happens if you skip the code and simply type the URL hash as in the example below:
https://ownthistown.wufoo.com/forms/q1d68ngv1qovy1o/def/&field1=http://wufoo.com
The field would show https:/wufoo.com as the entry. ANyone have any ideas why this is happening?

Related

Reference a custom field in NS on the standard HTML transaction form/SO email form

Does anyone know how to reference a NS field in the standard HTML form?
I have a custom field on my SO that links to our external website. The field uses a formula to pull the NS SO internal ID to create the link so we can send it out to the customer. That field works perfect and I was able to get that link to display properly as an element on the standard PDF form layout that gets emailed to the customer as an attachment on the SO notification email.
Now, here is the issue, I don't know how to reference it on the "a href" html tag in the HTML code on the transaction HTML layout. I know the field name/backend ID, I just don't know how to reference it in the "a href" html tag, this is what I have so far:
Securely View, Edit, & Track the status of this order
(in the curly brackets is my field name and I removed the carrots so the exact code would show up in this text box)
Does anyone know how to get that field from the SO form to show up in the Transaction HTML Layout form?
Actually I figured it out. I needed to have the href set as <NLCUSTBODYPG_LINK_SO>.

How to get form data value from html and show on other html page

I am working on a html page with an input bar. How can I get the form data from this page to another html page with a iframe? Because I need to embed the search result from other site but I want to show on my site new page. I just guess should use iframe. But I don't know how to get data and add in page address field.
You have several options here:
1) If your form uses GET method, then all the text data from the form will be passed to next page (which is set up as an "action" attribute of the form) in URL (like www.example.com/?name=John&lastname=Doe). After that, you can extract data from this URL using code from this StackOverflow question and put it inside HTML element using Javascript as well like it is done here
2) Whatever server language you use, you can get query variables from there and put them to the page before sending it to the client. In case of PHP, check this example. NB: don't forget about security.
3) You can temporarily store text in localStorage API of the browser. Simply set the value before submitting the form and then get it on the next page.
iFrame would be inefficient and not needed here.

What is the difference between null and ""

I am currently trying to understand the jsp codes of another guy but I am having trouble with the following codes:
if( request.getParameter("username")!=null &&
!request.getParameter("username").equals(""))
The username is the field a user fills on an HTML form. The codes after these codes saves the data the user fills in into strings which will be later used for other purposes.
My question is what is the purpose of the !request.getParameter("username").equals("") code part in the above?
Has request.getParameter("username")!=null part of the code not already tested whether the user enters information into the input field of the HTML form or not?
Regards
If you reveive a request like
http://.../yourservlet
then the parameter value will be null, since no parameter named username is passed at all.
If you reveive a request like
http://.../yourservlet?username=
then the parameter value will be the empty string, since the parameter is passed, but its value is the empty string.
What you'll receive depends on the HTML, and on what the user actually does (he could type the URL manually in the address bar, for example). The code makes sure both cases are handled in the same way. Let's imagine some JavaScript in the page disabled the input field or removes it from the DOM when some checkbox is checked. In that case, the parameter won't be sent at all.
Has request.getParameter("username")!=null part of the code not already tested whether the user enters information into the input field of the HTML form or not?
No. A text input in a HTML form will always send a value. If nothing has been typed into it, then that value will be "".

Extract POST URL using GET

I am trying to simulate the functionality of a form in this website, but don't know exactly what the post URL looks like.
The link to the website is here:
selfservice.mypurdue.purdue.edu/prod/bwckschd.p_disp_dyn_sched >> then click on Spring2013. The code I am trying to replicate is the one that happens when the user clicks Course Search and selects CS from the subject list.
You can look at the HTML file to see the values they use in their POST command. How do I see what the values look like once the button is clicked, as I am trying to replicate this and set the variables to the same values. What I need is a URL to be shown with all of the variables set to their respective values. I understand this can be done with a GET command. Can someone tell me how to extract this URL for me so I can proceed?
I edited the page using chrome inspector and changed the form action to GET - this is the URL that was displayed.
https://selfservice.mypurdue.purdue.edu/prod/bwckschd.p_get_crse_unsec?term_in=201320&sel_subj=dummy&sel_day=dummy&sel_schd=dummy&sel_insm=dummy&sel_camp=dummy&sel_levl=dummy&sel_sess=dummy&sel_instr=dummy&sel_ptrm=dummy&sel_attr=dummy&sel_subj=CS&sel_crse=&sel_title=&sel_schd=%25&sel_from_cred=&sel_to_cred=&sel_camp=%25&sel_ptrm=%25&sel_instr=%25&sel_sess=%25&sel_attr=%25&begin_hh=0&begin_mi=0&begin_ap=a&end_hh=0&end_mi=0&end_ap=a
However, this URL dosen't resolve as the script is obviously expecting POST data.

jSP form Query Parameters

While using an HTML form on a jsp page, the data/values automatically get picked up on submit and a url gets generated: nextPage.do?param1=value1&param2=value2
Is there a way to change the generated url without redirecting again: nextPage.do?q={param1=value1$param2=value2}.
Thanks.
Use JavaScript to handle the form submission, extract the parameters, and transform them. But be careful about special characters : what if some parameter value has a dollar sign inside? I wonder why you want to do that.