generate a unique invoice number -...

User 2796854 Photo


Registered User
44 posts

Eric Rohloff wrote:
Cool. :cool:


So I tested this on a white listed network and didn't work. Can't access https://ajax.googleapis.com/ajax/libs/j … ry.min.js.

Is there a way to generate the form ID from combing elements from the form + time of submission?

For example: The form has an element for Country, State, Site so the ID would be CoutnryStateCitytimeof submission?

I have found ways to combine elements and post to the same filed in a database but not post to an element on the submitted form.

User 187934 Photo


Senior Advisor
20,181 posts

Sure,;)
http://progrower.coffeecup.com/forms/invoice-elements/
Remember that jquery time is the users local time.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2796854 Photo


Registered User
44 posts

Eric Rohloff wrote:
Sure,;)
http://progrower.coffeecup.com/forms/invoice-elements/
Remember that jquery time is the users local time.




Thank you. Will test shortly. Best regards to you Eric.
User 2796854 Photo


Registered User
44 posts

Eric Rohloff wrote:
Sure,;)
http://progrower.coffeecup.com/forms/invoice-elements/
Remember that jquery time is the users local time.


Hi Eric,

First so you know - I have only been doing this for 2 weeks. the whole jq, java script, mysql and php. It has been a learning experience. I took your code and took me a while to get it to work. reconstructed it step by step and simplified it to get it work . but GOT IT TO WORK :) Thanks for the lesson. really appreciate it sir. I am learning thanks to you:

Here is what I did:

<script src="common/libs_js/jquery-1.4.4.min.js"></script> <script type="text/javascript">var jQ = $.noConflict(true);
jQ(document).ready(function()
{
jQ("input[name=invoice]").attr("readonly", true);
jQ("input[name=name], input[name=number]").change(function()
{
var name = jQ("input[name=name]").val();
var number = jQ("input[name=number]").val();
if(name == null || number == null || name == '' || number == '')
{
alert("Please enter both values");
jQ("input[name=invoice]").val('');
}
else
{jQ("input[name=invoice]").val(name +"-" +number);
}
});
});</script>
User 187934 Photo


Senior Advisor
20,181 posts

Sorry about the + signs. I used a code posting tool that converts html to post-able text and for some reason it took those out. If you look at the source code of my form their in there.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2796854 Photo


Registered User
44 posts

Isn't a dropdown also an Input element?

I am asking because the same method is not working if I change the input fields from text elements to a dropdown element.
User 187934 Photo


Senior Advisor
20,181 posts

Your probably looking for
jQ("select[name=mydropdownname]").val('');
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2796854 Photo


Registered User
44 posts

Eric Rohloff wrote:
Your probably looking for
jQ("select[name=mydropdownname]").val('');


Thanks Eric.

For some reason the Date Now() is returning 11 for the month instead of 12. Any idea why? Also I've tried to combine the value from a datepicker element but every time I added it to the change function the script would not run. I've also uploaded the example to sdrive to test; same results.

Here is what I have done:
<script src="common/libs_js/jquery-1.4.4.min.js"></script> <script type="text/javascript">var jQ = $.noConflict(true);
jQ(document).ready(function()
{
jQ("input[name=FormID]").attr("readonly", true);
jQ("select[name=State], select[name=City], select[name=Street]").change(function()
{
var State = jQ("select[name=State]").val();
var City = jQ("select[name=City]").val();
var Street = jQ("select[name=Street]").val();
var d = new Date(Date.now());
var curr_date = d.getDate();
var curr_month = d.getMonth();
var curr_year = d.getFullYear();

{jQ("input[name=FormID]").val(State+City+Street+curr_date+curr_month+curr_year);
}
});
});</script>
User 187934 Photo


Senior Advisor
20,181 posts

Can you share a link?
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2796854 Photo


Registered User
44 posts

Eric Rohloff wrote:
Can you share a link?


HI Eric,

here is the link: http://ghamian.coffeecup.com/forms/combine/

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.