I have a jQuery calculator that I built using a conversion tool called Appizy. It takes a excel calculation and converts it into jQuery and html.
Here is the site: https://staging-homecarepulse.kinsta.cloud/pricing-calc/
What I am trying to do is grab the input values that are displayed and append them to a link for example i want to create a dynamic link with these parameters
?demo_request_type=es&active_clients=[NUMBER]&active_caregivers=[NUMBER]
where number is, the input values from the calculator (NOT RESULTS) should show.
Would much appreciate any suggestion in the right direction.
Thank you!!
i was able to solve this by adding a value to my inputs
<input type="text" id="qta_field1" value="${item.value}"/>
I think added this my button link
onclick="this.href='http://www.google.com?demo_request_type=example&active_clients='+document.getElementById('qta_field1').value +'&active_caregivers='+document.getElementById('qta_field2').value"
this opens up a new window with the parameters set in the input field by the user
Related
I have to create text box dynamically on each button click and the previous values should be loaded correctly. I know by saving the value to hidden field i can achieve this. Is there any other option for achieving this. Because by increasing the number of the controls the hidden field value also increases
There may be multiple solution to your problem:
1. Save your values in session on each post back.
2. Or you can save your values in single hidden field with comma separated values.
For further assistance you can email me.
I wanted to create a calculator using HTML and JavaScript. I have already written the code and it works. But the main problem is that I cannot reset the input tag after I have already taken one input(like a calculator). I have an input tag like this:
Enter First Number:
<input id = "num1" placeholder = "First Number"/>
In my JavaScript there are functions like sum() which requires two numbers and functions like sine() which requires one number. So I want the input tag to be reset for taking another input after the first one for the sum() function. How do I do that?
Do you use jQuery? Can you give us a little overview of your code?
Its hard to give you an advice when we dont know the code.
In case of jQuery you can empty the inputs value by
$("input").val("") //Replace input with the fitting selector
If you are not using jQuery you can use:
document.getElementById('num1').value="";
This will clear the current value of the element. You should make sure that you have saved off the current value before you do this though.
I have HTML form and I would like to print the HTML form, with the User Filled Information/Content.
Is there exist any way in jQuery or JavaScript to get a HTML Form with user filled values and print it?
This is what I have tried
$(form).html() but it returns only empty form
$(document).find("form").html() which also returned html with empty form.
NOTE: I am not talking about serialize function here. I don't want to submit a form but want to convert form to a printable version by setting input, select background transparent.
You can use
$('form').find('input').each(function( key, value ) {
console.log(value);
});
And to get the data ready for POST or something like it use this
$('form').serialize();
I think I got your issue. What you are actually want is, to print the HTML form, but it should contain the User Input.
First and foremost, you can use the 'window.print()' method. If you want to print only the Form, then you should use some CSS tricks.
I guess, what you are looking is answered in the following SO Questions. Please check out.
Javascript print web form with user input included
How to print only a selected HTML element?
If you are still not able to get your solution done, then let me know. Let me see how I can help you. Good Luck.
I have a product form with 3 inputs
Price (fixed number)
Quantity (an input with type="text" where the user can enter a number)
Optional extra (a checkbox that the user can tick to add a number)
So far I have been using Javascript to get the value of the html elements, and then adding them and outputting the result into a html element.
I need the form to update on the fly, so that a user can enter a number into quantity and tick the box and the result update live. Unfortuantely I have been unbale to find a way to set variables when there is an update in a field, please see the link below of what I have done so far.
http://jsbin.com/tapen/2/watch?html,css,js,output
With Jquery its very easy to acess the value of an input field, or to set events to will execute when the field value is changed / updated.
As a pratical example i would suggest that you take a look in the code of a sample calculator using only jquery and html: http://firstemission.blogspot.com.br/2012/10/jquery-and-watermark-example.html
As I'm not that familiar with JavaScript, I did some research around the web to have sth. to go on, but was not able to solve my problem.
I created a fiddle to show you how it shall look like.
Well, my problem is that the light-grey pre-filled value "E-Mail" shall not be deletable, but the value itself shall be extendable in black font color.
Have you got an idea how to make it happen?
Thank you.
try this
http://jsfiddle.net/wf9zX/2/
use lable for that input field and concat input field value and lable text
Solution 1
Why wouldn't you use two inputs styled differently ? You can disable or make the first one readonly and still concat both input POST values.
I don't think styling INSIDE an input is very W3C friendly.
Solution 2
Use a background image (an image where "E-mail" is written) in your input with some padding-left. The when you get the POSt value, just add the string "E-mail" to it. It's like they do cutom search button icons on inputs.
See the new fiddle: http://jsfiddle.net/gxY5P/4/
Hope this helps.