Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old August 30th, 2004, 06:27 PM
LLX LLX is offline
Contributing User
Click here for more information
 
Join Date: Apr 2007
Location: Glendale, CA, USA
Posts: 1,131 LLX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 58 m
Reputation Power: 3
Send a message via AIM to LLX Send a message via Yahoo to LLX
text on the fly

i want to display next to certain form elements some text (yess or no)

noting complex just if a check box is clicked (on click java function call)

Write bla if not write something rlse, how would i go about that

Code:
<table border="0">
<TR>
<TD valign="top"><B>A US Citizen: </B></TD>
<TD valign="top"><INPUT type="checkbox" name="US_Citizen" onClick="javascript:Yes()"></TD>
</TR>
</table><BR>

Reply With Quote
  #2  
Old August 30th, 2004, 06:28 PM
LLX LLX is offline
Contributing User
Click here for more information
 
Join Date: Apr 2007
Location: Glendale, CA, USA
Posts: 1,131 LLX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 58 m
Reputation Power: 3
Send a message via AIM to LLX Send a message via Yahoo to LLX
RE: text on the fly

[code]
<table border="0">
<TR>
<TD valign="top"><B>A US Citizen: </B></TD>
<TD valign="top"><INPUT type="checkbox" name="US_Citizen" onClick="javascript:Yes()"> ::Yes/No Text here::</TD>
</TR>
</table><BR>
[code]

Reply With Quote
  #3  
Old August 30th, 2004, 06:45 PM
nawlej nawlej is offline
Contributing User
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Dallas, Tx. USA
Posts: 2,008 nawlej User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 7 m 51 sec
Reputation Power: 4
RE: text on the fly

you mean you want to have the text boxes display text after you check a checkbox by way of a javascript function? First you hav to give the javascript target a name. Say my textfield is named "blah" and my form name is "foo". In my Javascript function, I would write it to the text field like so:

document.foo.blah.value = "Value goes here";

it follows the format of document.formname.elementname.value

Reply With Quote
  #4  
Old August 30th, 2004, 06:49 PM
LLX LLX is offline
Contributing User
Click here for more information
 
Join Date: Apr 2007
Location: Glendale, CA, USA
Posts: 1,131 LLX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 58 m
Reputation Power: 3
Send a message via AIM to LLX Send a message via Yahoo to LLX
RE: text on the fly

im still rather new to java, (ha i 'mastered' php before Java, lol) would i have ot use a name filed on my form to name my form?

php Code:
Original - php Code
  1.  
  2. <html>
  3. <head>
  4.     <title>Order Books from Celebrities Staffing</title>
  5.     <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  6. <!-- begin
  7. function FillOut()
  8. {
  9. var tf=document.forms[0];
  10. tf.x_first_name.value=tf.x_ship_to_first_name.valu  e;
  11. tf.x_last_name.value=tf.x_ship_to_last_name.value; 
  12. tf.x_address.value=tf.x_ship_to_address.value;
  13. tf.x_city.value=tf.x_ship_to_city.value;
  14. tf.x_state.value=tf.x_ship_to_state.value;
  15. tf.x_zip.value=tf.x_ship_to_zip.value;
  16. tf.x_Country.value=tf.x_ship_to_Country.value;
  17. }
  18. function Yes()
  19. {
  20.  
  21. }//end -->
  22. </script>
  23.  
  24. </head>
  25. <body bgcolor="#e0e0e0" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">
  26.  
  27. <FORM action="https://secure.authorize.net/gateway/transact.dll" method="POST">
  28. <INPUT type="hidden" name="x_show_form" value="PAYMENT_FORM">
  29. <INPUT type="hidden" name="x_version" value="3.1">
  30. <INPUT type="hidden" name="x_email_customer" value="TRUE">
  31. <INPUT type="hidden" name="x_merchant_email" value="info@celebrity-insititute.com">
  32.  
  33. <?
  34. function formfield($title, $type, $name, $size){
  35. ?>
  36. <table border="0">
  37. <TR>
  38. <TD valign="top"><B><? echo $title; ?> </B></TD>
  39. <TD valign="top"><INPUT type="<? echo $type; ?>" name="<? echo $name; ?>" size="<? echo $size; ?>"></TD>
  40. </TR>
  41. </table><BR>
  42. <?
  43. }
  44.  
  45. formfield("First Name: ", "text", "x_ship_to_first_name", "30");
  46. formfield("Last Name: ", "text", "x_ship_to_last_name", "30");
  47. formfield("Company (Mailing): ", "text", "x_ship_to_company", "40");
  48. formfield("Address (Mailing): <BR><font size='-1'>(No P.O.Box unless you live outside the US.)</font>", "text", "x_ship_to_address", "60");
  49. formfield("City (Mailing): ", "text", "x_ship_to_city", "40");
  50. formfield("State (Mailing): ", "text", "x_ship_to_state", "40");
  51. formfield("Zip (Mailing): ", "text", "x_ship_to_zip", "40");
  52. formfield("Country (Mailing): ", "text", "x_ship_to_country", "60");
  53.  
  54. formfield("Telephone No.: ", "text", "Telephone1", "20");
  55. formfield("Cell/Alt No.: ", "text", "Cellphone", "20");
  56. formfield("Email: ", "text", "x_email", "30");
  57. ?>
  58. <table border="0">
  59. <TR>
  60. <TD valign="top"><B>Gender: </B></TD>
  61. <TD valign="top"><INPUT type="select" name="gender" size="1">
  62. <option>Male</option>
  63. <option>Female</option>
  64. </select></TD>
  65. </TR>
  66. </table><BR>
  67. Are you<BR>
  68. <table border="0">
  69. <TR>
  70. <TD valign="top"><B>A US Citizen: </B></TD>
  71. <TD valign="top"><INPUT type="checkbox" name="US_Citizen" onClick="javascript:Yes()"> ::Yes/No Text here::</TD>
  72. </TR>
  73. </table><BR>
  74. <table border="0">
  75. <TR>
  76. <TD valign="top"><B>A US Resident: </B></TD>
  77. <TD valign="top"><INPUT type="checkbox" name="US_Resident"></TD>
  78. </TR>
  79. </table><BR>
  80. <table border="0">
  81. <TR>
  82. <TD valign="top"><B>A Visitor in the US: </B></TD>
  83. <TD valign="top"><INPUT type="checkbox" name="US_Visitor"></TD>
  84. </TR>
  85. </table><BR>
  86. <table border="0">
  87. <TR>
  88. <TD valign="top"><B>Live outside the US: </B></TD>
  89. <TD valign="top"><INPUT type="checkbox" name="Live_Outside_US"></TD>
  90. </TR>
  91. </table><BR>
  92. If you are a US Citizen or US Resident please provide your Social Security Number
  93. <?
  94. formfield("Social Security Number", "text", "social_sec", "16");
  95. ?>
  96. <table border="0">
  97. <TR>
  98. <TD valign="top"><B>Are you 18 years or over: </B></TD>
  99. <TD valign="top"><INPUT type="select" name="older_then_18" size="1">
  100. <option>Yes</option>
  101. <option>No</option>
  102. </select></TD>
  103. </TR>
  104. </table><BR>
  105. Educational Background:<BR><BR>
  106. <?
  107. formfield("High School: ", "text", "high_school", "30");
  108. formfield("GED", "text", "GED", "30");
  109. formfield("College Educated", "text", "College", "30");
  110. formfield("Other: <BR><font size='-1'>Please Explain</font>", "text", "other_edu", "50");
  111.  
  112.     include ("loginfo.php");
  113.  
  114.  
  115.       $dbcnx = mysql_connect("$sqlhost", "$sqluser", "$sqlpass");
  116.       $con = mysql_select_db("$sqldb");
  117.       if(!$dbcnx)die("Cannot connect to mySQL Server");
  118.       if(!$con)die("Cannot Load Database");
  119.  
  120.       $queryCheck = "SELECT title,sub_title FROM courses Order by listing_order";
  121.  
  122.       $rst1 = mysql_query($queryCheck,$dbcnx);
  123.       $num_rows = mysql_num_rows($rst1);
  124. ?>
  125. <table border="0">
  126. <TR>
  127. <TD valign="top"><B>Are you 18 years or over: </B></TD>
  128. <TD valign="top"><INPUT type="select" name="older_then_18" size="1">
  129. <?
  130.       while(list($title,$sub_title)=mysql_fetch_array($r  st1,MYSQL_NUM)){
  131. echo "<option>" . $title. " " . $sub_title . "</option>";
  132. }
  133. ?>
  134. </select></TD>
  135. </TR>
  136. </table><BR>
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150. formfield($title, $type, $name, $size);
  151. formfield($title, $type, $name, $size);
  152. formfield($title, $type, $name, $size);
  153. formfield($title, $type, $name, $size);
  154. formfield($title, $type, $name, $size);
  155. formfield($title, $type, $name, $size);
  156. formfield($title, $type, $name, $size);
  157. ?>
  158. </FORM>
  159. </body>
  160. </html>

Reply With Quote
  #5  
Old August 30th, 2004, 07:01 PM
nawlej nawlej is offline
Contributing User
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Dallas, Tx. USA
Posts: 2,008 nawlej User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 7 m 51 sec
Reputation Power: 4
RE: text on the fly

<!--
//---Quick interjection---
thats not java, its javascript. Both are different enough to notice
//---End Interjection---->

Yes, its always a good idea to name your forms when dealing with something objective.

Reply With Quote
  #6  
Old August 30th, 2004, 07:10 PM
LLX LLX is offline
Contributing User
Click here for more information
 
Join Date: Apr 2007
Location: Glendale, CA, USA
Posts: 1,131 LLX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 58 m
Reputation Power: 3
Send a message via AIM to LLX Send a message via Yahoo to LLX
RE: text on the fly

ok i know i dont have it just yet but is this atleast the right direction?

php Code:
Original - php Code
  1.  
  2. <html>
  3. <head>
  4.     <title>Order Books from Celebrities Staffing</title>