User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 456,490 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,707 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 960 | Replies: 3
Reply
Join Date: Aug 2007
Posts: 53
Reputation: nil_gh_80 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
nil_gh_80's Avatar
nil_gh_80 nil_gh_80 is offline Offline
Junior Poster in Training

subscripts & superscripts.......in php

  #1  
Sep 19th, 2007
How can I insert text in special form in a textarea and as well as in the database......
e.g.
  1. [b]H<sub>2</sub>O[/b]
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2006
Location: Netherlands
Posts: 223
Reputation: Anonymusius is on a distinguished road 
Rep Power: 3
Solved Threads: 10
Anonymusius's Avatar
Anonymusius Anonymusius is offline Offline
Posting Whiz in Training

Re: subscripts & superscripts.......in php

  #2  
Sep 19th, 2007
with tags. You can replace [sub] and [/sub] with <sub> and </sub>, and then enter it in your DB. You should watch out for unclosed tags though, if you write [sub] and not close it all following text will be subscript. You should be able to figger it out.
Reply With Quote  
Join Date: Aug 2007
Posts: 53
Reputation: nil_gh_80 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
nil_gh_80's Avatar
nil_gh_80 nil_gh_80 is offline Offline
Junior Poster in Training

Re: subscripts & superscripts.......in php

  #3  
Sep 20th, 2007
actually I have a textbox where i've to enter texts like some chemical equations and when I will click submit button that text will enter in my database............give me some idea...........
Reply With Quote  
Join Date: Jun 2007
Location: Valley Center, Kansas
Posts: 643
Reputation: kkeith29 is on a distinguished road 
Rep Power: 3
Solved Threads: 72
kkeith29's Avatar
kkeith29 kkeith29 is offline Offline
Practically a Master Poster

Re: subscripts & superscripts.......in php

  #4  
Sep 20th, 2007
I am still trying to figure out exact what you want but i'll try. You could use javascript to insert the tags into the textarea.

<input type="button" value="Subscript" onclick="document.getElementById('message').value+='[sub][/sub]'">

Then use php to find and replace "[sub]" & "[/sub]" with the proper tags and then insert them into the database. Is that what you want?
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 3:19 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC