Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 PHP to ASP
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Biddyman
Starting Member

32 Posts

Posted - 14 January 2008 :  21:13:57  Show Profile  Visit Biddyman's Homepage  Send Biddyman a Yahoo! Message
How would these be changed to ASP?

if($FTGCHECKBOXFIELDNAME == "VALUE1") { 
      $ErrorPage = str_replace('value="'.$value_val.'"', 'value="'.$value_val.'" CHECKED', $ErrorPage); 
   }


$valuelist = array('VALUE1', 'VALUE2', 'VALUE3'); 
 foreach($valuelist as $value_val) { 
    if($FTGSELECTFIELDNAME == $value_val) { 
      $ErrorPage = str_replace('"'.$value_val.'"', '"'.$value_val.'" SELECTED', $ErrorPage); 
      break; 
   } 
 }

phy1729
Average Member

USA
589 Posts

Posted - 14 January 2008 :  23:17:56  Show Profile
Sort of late but I think

if FTGCHECKBOXFIELDNAME = "VALUE1" then 
	      ErrorPage = Replace(ErrorPage, "value=""".value_val."""", "value=""".value_val.""" CHECKED"); 
end if


dim valuelist(2)
valuelist(0) = "VALUE1"
valuelist(1) = "VALUE2"
valuelist(2) = "VALUE3" 
for each value_val in valuelist
	    if FTGSELECTFIELDNAME = value_val then 
		      ErrorPage = Replace(ErrorPage, """".value_val."""", """".value_val.""" SELECTED");
		      break 
	   end if 
next

Not sure about the cat operator or break but hope this helps.
Go to Top of Page

Biddyman
Starting Member

32 Posts

Posted - 14 January 2008 :  23:43:42  Show Profile  Visit Biddyman's Homepage  Send Biddyman a Yahoo! Message
That helps alot. Thanks.
Go to Top of Page

muzishun
Senior Member

United States
1079 Posts

Posted - 14 January 2008 :  23:47:52  Show Profile  Visit muzishun's Homepage

If FTGCHECKBOXFIELDNAME = "VALUE1" Then
	ErrorPage = Replace(ErrorPage, "value""" & value_val & """", value=""" & value_val & """ checked")
End If

Dim valuelist(2)
valuelist(0) = "VALUE1"
valuelist(1) = "VALUE2"
valuelist(2) = "VALUE3"

For Each value_val In valuelist
	If FTGSELECTFIELDNAME = value_val Then
		ErrorPage = Replace(ErrorPage, """ & value_val & """, """ & value_val & """ selected")
	End If
Next


That should do what you need. If it doesn't, try posting a little more of what you're working with to give context to what you need the code to do.

Bill Parrott
Senior Web Programmer, University of Kansas
Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com)
Personal Website (www.chimericdream.com)

Edited by - muzishun on 14 January 2008 23:49:02
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.27 seconds. Powered By: Snitz Forums 2000 Version 3.4.07