View Full Version : Resolved my code doesn't work

05-31-2009, 03:43 PM
help, i don't know why my code is not working at all, it was expected to produce a prompt once the end user did not put anything on the forms

<script type="text/javscript">
function check_data(my_form){
var problem = false;
alert("Enter your name. ");
my_form.name.value="*** Name";
problem = true;

alert("Enter your email address. ");
my_form.email.value="*** Email Address";
problem = true;

alert("Enter url. ");
my_form.url.value="*** URL";
problem = true;

if((my_form.url_category.selectedIndex == 0) || (my_form.url_category.value == 0)) {
alert("please select a category for this URL");
problem = true;

return false;
return true;

<form name="url_form" action="handle_submit_url.php" method="post" onsubmit="return check_data(this);">
<fieldset><legend>Enter Your information in the form below:</legend>
<p><b>Your Name:</b><input type="text" name="name" size="40" maxlength="60" /></p>
<p><b>Email Address:</b><input type="text" name="email" size="40" maxlength="60" /></p>
<p><b>URL:</b><input type="text" name="url" size="40" maxlength="80"></p>
<p><b>URL Category:</b><select name="url_category">
<option>Choose One:</option>
<option value="3">Code Libraries</option>
<option value="6">General Database</option>
<option value="5">General MySQL</option>
<option value="1">General PHP</option>
<option value="4">Programming</option>
<option value="2">Web Development</option>
<div align="center"><input type="submit" name="submit" value="submit" /></div>

05-31-2009, 04:04 PM
It's just a typo.

<script type="text/javascript">

05-31-2009, 04:27 PM
Thanks for the help sir,... :) ...is there a way, we can mark this thread as "resolved"?

Philip M
05-31-2009, 06:21 PM
Thanks for the help sir,... :) ...is there a way, we can mark this thread as "resolved"?

6) Thread prefixes usage. In some forums, you can select from a list a prefix to add to your thread's title, for example, a prefix of "resolved" once you've received a satisfactory answer to your question. To add a prefix after your thread has been initially posted, click on the "Edit" button under the first post of the thread, then the "Go Advanced" button. You have 14 days to update your thread's title.