| | |
Textbox validate
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jun 2009
Posts: 1
Reputation:
Solved Threads: 0
Hi everyone,
Firstly,sorry about my bad english.i hope telling my problem clearly
anyway i want to tell about my project.it s about survey system..I am creatin g dynamic questions and question's choices(radiobuttons or checkboxes) from database when runtime..after users answer the question,press next button to pass the next questions
For examle
1) Question definition
a)choice definition
b)choice definition
c)....
Users have to choosee any choices..if not,my system is giving alert,Actually my problem is about checkboxes..I created hidden textboxes,if question choices' type is checkbox..so the last choice definition is name "Other"..if user checks the other choice,the hidden textbox is going to be visible..it is all okay until here..I want to give a error alert if user checks the other choice and doesnt fill the textbox when press next question..I dont validate this..How can i do it..Anyone can help me?
Thanks for all...
Firstly,sorry about my bad english.i hope telling my problem clearly
anyway i want to tell about my project.it s about survey system..I am creatin g dynamic questions and question's choices(radiobuttons or checkboxes) from database when runtime..after users answer the question,press next button to pass the next questionsFor examle
1) Question definition
a)choice definition
b)choice definition
c)....
Users have to choosee any choices..if not,my system is giving alert,Actually my problem is about checkboxes..I created hidden textboxes,if question choices' type is checkbox..so the last choice definition is name "Other"..if user checks the other choice,the hidden textbox is going to be visible..it is all okay until here..I want to give a error alert if user checks the other choice and doesnt fill the textbox when press next question..I dont validate this..How can i do it..Anyone can help me?
Thanks for all...
0
#2 Nov 3rd, 2009
You could do a check on the value something like
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
if (tBox.value != ""){//proceed to next question}else{alert("Please enter a value in the textbox")}
Life... Is a Moment
•
•
Join Date: Oct 2009
Posts: 17
Reputation:
Solved Threads: 2
0
#3 Nov 4th, 2009
•
•
•
•
Hi everyone,
Firstly,sorry about my bad english.i hope telling my problem clearlyanyway i want to tell about my project.it s about survey system..I am creatin g dynamic questions and question's choices(radiobuttons or checkboxes) from database when runtime..after users answer the question,press next button to pass the next questions
For examle
1) Question definition
a)choice definition
b)choice definition
c)....
Users have to choosee any choices..if not,my system is giving alert,Actually my problem is about checkboxes..I created hidden textboxes,if question choices' type is checkbox..so the last choice definition is name "Other"..if user checks the other choice,the hidden textbox is going to be visible..it is all okay until here..I want to give a error alert if user checks the other choice and doesnt fill the textbox when press next question..I dont validate this..How can i do it..Anyone can help me?
Thanks for all...
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
function check_form() { if (document.getElementById('the_other_checkbox_id').checked==true) if(document.getElementById('the_textbox_id').value=="") alert('something'); else go_to_next_question(); }
![]() |
Similar Threads
- two different validation with two different buttons. in web application (ASP.NET)
- Correct Syntax for calling a Javascript function in code behind (ASP.NET)
- How to Validate multiple textboxes using Required field / javascript function (ASP.NET)
- Manipulate Table Data...? (C#)
- NumericUpDown - No maximum or minimum (C#)
- Code Snippet: Capturing numeric input in a TextBox (C#)
- innerHTML validation problem (JavaScript / DHTML / AJAX)
- How to validate the textbox in datagrid using javascript? (ASP.NET)
- How do I validate a TAB event? (Visual Basic 4 / 5 / 6)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: responseText format??
- Next Thread: please help onClick js code
Views: 467 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for JavaScript / DHTML / AJAX
ajax ajaxexample ajaxjspservlets array autoplay blackjack browser captcha captchaformproblem cart child class close codes date debugger dependent developer disablefirebug dom editor element embed engine enter events explorer ext file firefox flash form forms frameworks game gears getselection google gxt hiddenvalue highlightedword hint html ie7 ie8 iframe java javascript javascripthelp2020 jquery jsf jsp jump libcurl maps margin marquee masterpage math media menu object onerror onmouseoutdivproblem onreadystatechange parent passing paypal pdf php player position post programming prototype rated redirect safari scale scriptlets scroll search security size software solutions sources star stars stretch synchronous toggle tweet unicode variables web webkit webservice window \n





