Jump to content

Help Me, Please


quangthang2004

Recommended Posts

Dear All, As you known, I am a freshman in Javascript and I get used to do jquery library in recent time. It is because I am facing a problem about validatetion form. During the working, I am try to script a function to return RegExp object .I meant an value will return true or false based on the RegExp that I wrote before but it did not work. I am , Therefore, here today. I would like to ask you about theory how to do. Please give me some suggestion or some recommendation . I will be grateful If you consider my request.I wish you have a nice weekend Thanks in advance

Link to comment
Share on other sites

Ditto. Posting your work, however flawed, is the easiest way to get help and best way to get the help you need. Unlike brick and mortar learning, where most of the questions have been created for you a and all you have to do is find the answer, learning on a forum requires you to be able present at least a partial answer (that might be completely wrong) and design a thoughtful question based on your work! Online learning is tough if you don't have courage and humility. Personally, it's the toughest learning I've every experienced and the most valuable. Coders are guaranteed to have enough of what they need for the rest of their lives. So, do the relevant tutorials before you post and don't be afraid to get your feet wet.

Link to comment
Share on other sites

Dear All, I know all of you are trying to help me and I really appreciate your comments. But I do not know how to speak or express. So I think I should go step by step with my problem.-------------------------------------------------------------var defaults = { username: { name: 'username', require: 'text', message: 'Please enter username' }, email:{ name: 'email', require: 'email', message: 'Please enter your email' }, phone: { name: 'phone', require: 'number', message: 'Please enter your phone' }, regExp: { username: /\w/, email: /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/, phon: /\b\d{1,2}[\/-]\d{1,2}[\/-]\d{4}\b/ } };------------------------------------------------------as you can see above code. you can see each variable such as username, email and phone having name , require and message. Name is for jquery object for example id, class. Require is for constraint and message is for notifying error. I would like to ask do you know how to print 'var defaults' out such as if I would like to know the content in "name of username" what should i do. I meant as you can see the content in "name of username" is "username". So how can I print this value out instead of using "defaults.username.name". Moreover, If I would like to print out the content of name of username, email, phone what should I do. I am so sorry If my English causes you headache because I am not good at English.Thanks in advance

Link to comment
Share on other sites

I would like to ask do you know how to print 'var defaults' out such as if I would like to know the content in "name of username" what should i do. I meant as you can see the content in "name of username" is "username". So how can I print this value out instead of using "defaults.username.name". Moreover, If I would like to print out the content of name of username, email, phone what should I do.
there is no other way really. That's the literal way of traversing an object through it's key's to print out the respective values.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...